Diff for /Amaya/amaya/templateInstantiate.c between versions 1.98 and 1.99

version 1.98, 2008/11/19 08:42:36 version 1.99, 2008/11/21 14:08:52
Line 231  static void InstantiateAttribute (XTiger Line 231  static void InstantiateAttribute (XTiger
   
 /*----------------------------------------------------------------------  /*----------------------------------------------------------------------
   ParseTemplate    ParseTemplate
   loading is TRUE when the document is not already loaded  
   parentLine points to the enclosing pseudo paragraph or paragraph    parentLine points to the enclosing pseudo paragraph or paragraph
     Parameter loading is TRUE when the document is not already loaded.
   Return the parentline to be considered for next elements    Return the parentline to be considered for next elements
   ----------------------------------------------------------------------*/    ----------------------------------------------------------------------*/
 static Element ParseTemplate (XTigerTemplate t, Element el, Document doc,  static Element ParseTemplate (XTigerTemplate t, Element el, Document doc,
Line 554  void CreateTemplate (Document doc, char Line 554  void CreateTemplate (Document doc, char
   CreateInstance    CreateInstance
   basedoc is the displayed doc that launchs the creation of instance    basedoc is the displayed doc that launchs the creation of instance
   ----------------------------------------------------------------------*/    ----------------------------------------------------------------------*/
 void CreateInstance(char *templatePath, char *instancePath,  void CreateInstance (char *templatePath, char *instancePath,
                     char *docname,  DocumentType docType, int basedoc)                       char *docname,  DocumentType docType, int basedoc)
 {  {
 #ifdef TEMPLATES  #ifdef TEMPLATES
   Document          doc = 0, newdoc = 0;    Document          doc = 0, newdoc = 0;
Line 810  Element InsertWithNotify (Element el, El Line 810  Element InsertWithNotify (Element el, El
   @param dec Template declaration of the element to insert    @param dec Template declaration of the element to insert
   @return The inserted element (the xt:use element if insertion is multiple as component)    @return The inserted element (the xt:use element if insertion is multiple as component)
   ----------------------------------------------------------------------*/    ----------------------------------------------------------------------*/
 Element Template_InsertUseChildren(Document doc, Element el, Declaration dec)  Element Template_InsertUseChildren (Document doc, Element el, Declaration dec)
 {  {
   Element     newEl = NULL;    Element         newEl = NULL;
 #ifdef TEMPLATES  #ifdef TEMPLATES
   Element     current = NULL;    Element         current = NULL;
   Element     child = NULL;    Element         child = NULL;
   //char       *attrCurrentTypeValue;    ElementType     elType;
   //ElementType elType;    XTigerTemplate  t;
       
   if (TtaGetDocumentAccessMode(doc))    if (TtaGetDocumentAccessMode(doc))
   {    {
Line 839  Element Template_InsertUseChildren(Docum Line 839  Element Template_InsertUseChildren(Docum
 #ifdef TEMPLATE_DEBUG  #ifdef TEMPLATE_DEBUG
         DumpSubtree(newEl, doc, 0);          DumpSubtree(newEl, doc, 0);
 #endif /* TEMPLATE_DEBUG */  #endif /* TEMPLATE_DEBUG */
         child = TtaGetFirstChild(newEl);          t = GetXTigerDocTemplate(doc);
           child = TtaGetFirstChild (newEl);
         while (child)          while (child)
           {            {
             // move the new subtree to the document              // move the new subtree to the document
             TtaRemoveTree (child, doc);              TtaRemoveTree (child, doc);
             current = InsertWithNotify (child, current, el, doc);              current = InsertWithNotify (child, current, el, doc);
             child = TtaGetFirstChild(newEl);              child = TtaGetFirstChild (newEl);
           }            }
           
         /* Copy currentType attribute. */  
         //attrCurrentTypeValue = GetAttributeStringValue (el, Template_ATTR_currentType, NULL);  
         //SetAttributeStringValue (el, Template_ATTR_currentType, attrCurrentTypeValue);  
         TtaDeleteTree(newEl, doc);          TtaDeleteTree(newEl, doc);
         newEl = el;          newEl = el;
         break;          break;

Removed from v.1.98  
changed lines
  Added in v.1.99


Webmaster