version 1.213, 2008/10/14 10:37:19
|
version 1.214, 2008/10/14 16:28:45
|
Line 123 char *GetUsedTypeName (Element el)
|
Line 123 char *GetUsedTypeName (Element el)
|
} |
} |
|
|
/*---------------------------------------------------------------------- |
/*---------------------------------------------------------------------- |
|
IsInLineTemplateElement returns TRUE if the template element can be |
|
inserted into a paragraph |
|
----------------------------------------------------------------------*/ |
|
ThotBool IsInLineTemplateElement (Element el, Document doc) |
|
{ |
|
#ifdef TEMPLATES |
|
XTigerTemplate t; |
|
ElementType elType; |
|
Declaration dec; |
|
char *name = NULL; |
|
|
|
elType = TtaGetElementType (el); |
|
if (elType.ElTypeNum == Template_EL_useEl || |
|
elType.ElTypeNum == Template_EL_useSimple) |
|
{ |
|
t = GetXTigerDocTemplate(doc); |
|
if (t) |
|
{ |
|
name = GetUsedTypeName (el); |
|
dec = Template_GetDeclaration (t, name); |
|
TtaFreeMemory (name); |
|
if (dec) |
|
return !dec->blockLevel; |
|
else |
|
return FALSE; |
|
} |
|
} |
|
#else /* TEMPLATES */ |
|
#endif /* TEMPLATES */ |
|
return FALSE; |
|
} |
|
|
|
/*---------------------------------------------------------------------- |
Test if a document is an internal template. |
Test if a document is an internal template. |
(no instance is opened and it is not edited) |
(no instance is opened and it is not edited) |
----------------------------------------------------------------------*/ |
----------------------------------------------------------------------*/ |
Line 131 ThotBool IsInternalTemplateDocument(Docu
|
Line 164 ThotBool IsInternalTemplateDocument(Docu
|
#ifdef TEMPLATES |
#ifdef TEMPLATES |
XTigerTemplate t = GetXTigerDocTemplate(doc); |
XTigerTemplate t = GetXTigerDocTemplate(doc); |
if (t) |
if (t) |
return (t->state&templInternal)!=0; |
return (t->state & templInternal) != 0; |
else |
else |
return FALSE; |
return FALSE; |
#else /* TEMPLATES */ |
#else /* TEMPLATES */ |
Line 1093 ThotBool UseButtonClicked (NotifyElement
|
Line 1126 ThotBool UseButtonClicked (NotifyElement
|
Document doc = event->document; |
Document doc = event->document; |
Element el = event->element; |
Element el = event->element; |
Element child; |
Element child; |
ElementType elType; |
ElementType elType, childType; |
XTigerTemplate t; |
XTigerTemplate t; |
Declaration decl; |
Declaration decl; |
Element firstEl; |
Element firstEl; |
Line 1117 ThotBool UseButtonClicked (NotifyElement
|
Line 1150 ThotBool UseButtonClicked (NotifyElement
|
t = GetXTigerDocTemplate(doc); |
t = GetXTigerDocTemplate(doc); |
if (!t) |
if (!t) |
return FALSE; /* let Thot perform normal operation */ |
return FALSE; /* let Thot perform normal operation */ |
elType = TtaGetElementType(el); |
|
|
|
firstEl = TtaGetFirstChild(el); |
elType = TtaGetElementType (el); |
if (firstEl) |
firstEl = TtaGetFirstChild (el); |
{ |
childType = TtaGetElementType (firstEl); |
RepeatButtonClicked(event); |
if (firstEl && |
} |
// TemplateObject is just a place holder |
|
(childType.ElSSchema != elType.ElSSchema || |
|
childType.ElTypeNum != Template_EL_TemplateObject)) |
|
RepeatButtonClicked(event); |
else |
else |
{ |
{ |
types = GetAttributeStringValueFromNum(el, Template_ATTR_types, NULL); |
types = GetAttributeStringValueFromNum(el, Template_ATTR_types, NULL); |