version 1.30, 2008/09/30 09:58:01
|
version 1.31, 2008/09/30 10:38:13
|
Line 116 void GiveAttributeStringValueFromNum (El
|
Line 116 void GiveAttributeStringValueFromNum (El
|
|
|
|
|
/*---------------------------------------------------------------------- |
/*---------------------------------------------------------------------- |
Returns the value of a string attribute |
Returns the value of a string attribute or NULL |
----------------------------------------------------------------------*/ |
----------------------------------------------------------------------*/ |
char *GetAttributeStringValueFromNum (Element el, int att, int* sz) |
char *GetAttributeStringValueFromNum (Element el, int att, int* sz) |
{ |
{ |
Line 129 char *GetAttributeStringValueFromNum (El
|
Line 129 char *GetAttributeStringValueFromNum (El
|
attType.AttrSSchema = TtaGetElementType(el).ElSSchema; |
attType.AttrSSchema = TtaGetElementType(el).ElSSchema; |
attType.AttrTypeNum = att; |
attType.AttrTypeNum = att; |
attribute = TtaGetAttribute(el, attType); |
attribute = TtaGetAttribute(el, attType); |
|
if (attribute == NULL) |
|
return NULL; |
|
|
size = TtaGetTextAttributeLength(attribute); |
size = TtaGetTextAttributeLength (attribute); |
aux = (char*) TtaGetMemory(size+1); |
aux = (char*) TtaGetMemory (size+1); |
TtaGiveTextAttributeValue (attribute, aux, &size); |
TtaGiveTextAttributeValue (attribute, aux, &size); |
aux[size] = EOS; |
aux[size] = EOS; |
if(sz) |
if (sz) |
*sz = size; |
*sz = size; |
return aux; |
return aux; |
#else |
#else |
Line 213 char *GetAttributeStringValue (Element e
|
Line 215 char *GetAttributeStringValue (Element e
|
#endif /* TEMPLATES */ |
#endif /* TEMPLATES */ |
} |
} |
|
|
|
/*---------------------------------------------------------------------- |
|
GetAncestorComponentName returns the name of the ancestor component |
|
or NULL; |
|
----------------------------------------------------------------------*/ |
|
char *GetAncestorComponentName (Element *el) |
|
{ |
|
#ifdef TEMPLATES |
|
ElementType elType; |
|
Element anc = NULL; |
|
char *name; |
|
|
|
elType = TtaGetElementType (*el); |
|
elType.ElTypeNum = Template_EL_component; |
|
anc = TtaGetParent (*el); |
|
anc = TtaGetExactTypedAncestor (anc, elType); |
|
if (anc) |
|
{ |
|
name = GetAttributeStringValueFromNum (anc, Template_ATTR_name, NULL); |
|
*el = anc; |
|
return name; |
|
} |
|
#else |
|
return NULL; |
|
#endif /* TEMPLATES */ |
|
} |
|
|
|
|
/*---------------------------------------------------------------------- |
/*---------------------------------------------------------------------- |
GetFirstEditableElement |
GetFirstEditableElement |