Diff for /Amaya/amaya/templates.c between versions 1.77 and 1.78

version 1.77, 2006/09/29 07:34:27 version 1.78, 2006/09/29 09:20:07
Line 399  ThotBool RepeatMenuClicked (NotifyElemen Line 399  ThotBool RepeatMenuClicked (NotifyElemen
         int              nbitems, size;          int              nbitems, size;
         struct menuType *items;          struct menuType *items;
   char            *types, *menuString;    char            *types, *menuString;
     ThotBool          oldStructureChecking;
   View            view;    View            view;
   
   TtaGetActiveView (&doc, &view);    TtaGetActiveView (&doc, &view);
   if (view != 1)    if (view != 1)
     return FALSE; /* let Thot perform normal operation */      return FALSE; /* let Thot perform normal operation */
   
   doc = event->document;    doc = event->document;
   t = (XTigerTemplate) Get (Templates_Dic, DocumentMeta[doc]->template_url);    t = (XTigerTemplate) Get (Templates_Dic, DocumentMeta[doc]->template_url);
   if (!t)    if (!t)
     return FALSE; /* let Thot perform normal operation */      return FALSE; // no template ?!?!
         types = "top end";                types = "begining end"; 
         size = strlen (types);          size = strlen (types);
         giveItems (types, size, &items, &nbitems);          giveItems (types, size, &items, &nbitems);
         menuString = createMenuString (items, nbitems);          menuString = createMenuString (items, nbitems);
Line 428  ThotBool RepeatMenuClicked (NotifyElemen Line 428  ThotBool RepeatMenuClicked (NotifyElemen
         {          {
           elt = TtaGetElementType (el);            elt = TtaGetElementType (el);
           elt1 = TtaGetElementType (child);            elt1 = TtaGetElementType (child);
           if (elt.ElSSchema == elt1.ElSSchema &&            if (elt.ElSSchema == elt1.ElSSchema)
               (elt1.ElTypeNum == Template_EL_useEl ||  
                elt1.ElTypeNum == Template_EL_useSimple))  
             {              {
               newEl = InstantiateUse (t, child, doc, FALSE);                if (elt1.ElTypeNum == Template_EL_useEl ||
                     elt1.ElTypeNum == Template_EL_useSimple)
                   newEl = InstantiateUse (t, child, doc, FALSE);
                 else if (elt1.ElTypeNum == Template_EL_folder)
                   newEl = TtaCopyTree (child, doc, doc, el);
                 else
                   newEl = NULL;
               if (newEl)                if (newEl)
                 {                  {
                     oldStructureChecking = TtaGetStructureChecking (doc);
                     TtaSetStructureChecking (FALSE, doc);
                   if (ReturnOption == 0)                    if (ReturnOption == 0)
                     TtaInsertFirstChild (&newEl, el, doc);                      TtaInsertFirstChild (&newEl, el, doc);
                   else                    else
Line 442  ThotBool RepeatMenuClicked (NotifyElemen Line 448  ThotBool RepeatMenuClicked (NotifyElemen
                       child = TtaGetLastChild (el);                        child = TtaGetLastChild (el);
                       TtaInsertSibling (newEl, child, FALSE, doc);                        TtaInsertSibling (newEl, child, FALSE, doc);
                     }                      }
                     TtaSetStructureChecking (oldStructureChecking, doc);
                 }                  }
             }              }
         }          }

Removed from v.1.77  
changed lines
  Added in v.1.78


Webmaster