Diff for /Amaya/amaya/templates.c between versions 1.244 and 1.245

version 1.244, 2009/08/27 16:12:57 version 1.245, 2009/08/28 09:02:27
Line 1332  ThotBool OptionButtonClicked (NotifyElem Line 1332  ThotBool OptionButtonClicked (NotifyElem
           child = next;            child = next;
         }          }
       while (next);        while (next);
       childType.ElSSchema = useType.ElSSchema;        child = Template_FillEmpty (el, doc);
       childType.ElTypeNum = Template_EL_TemplateObject;        if (child)
       child = TtaNewElement (doc, childType);          {
       TtaInsertFirstChild (&child, el, doc);            TtaRegisterElementCreate (child, doc);
       TtaRegisterElementCreate (child, doc);            TtaSetAccessRight (child, ReadOnly, doc);
       TtaSetAccessRight (child, ReadOnly, doc);          }
       SetAttributeIntValue (el, Template_ATTR_option,        SetAttributeIntValue (el, Template_ATTR_option,
                             Template_ATTR_option_VAL_option_unset, TRUE);                              Template_ATTR_option_VAL_option_unset, TRUE);
     }      }
Line 1704  ThotBool TemplateElementWillBeCreated (N Line 1704  ThotBool TemplateElementWillBeCreated (N
                       DoReplicateUseElement (t, doc, 1, ancestor, parent, name);                        DoReplicateUseElement (t, doc, 1, ancestor, parent, name);
                       TtaFreeMemory (name);                        TtaFreeMemory (name);
                     }                      }
                     TtaFreeMemory(types);
                   return TRUE; // don't let Thot do the job                    return TRUE; // don't let Thot do the job
                 }                  }
   
Line 2243  void TemplateCreateImport (Document doc, Line 2244  void TemplateCreateImport (Document doc,
             parent = selElem;              parent = selElem;
           else            else
             {              {
               elType.ElSSchema = sstempl;                parent = TemplateGetParentHead (selElem, doc);
               elType.ElTypeNum = Template_EL_head;  
               parent = TtaGetExactTypedAncestor (selElem, elType);  
               if (parent == NULL)  
                 {  
                   elType.ElTypeNum = Template_EL_Template;  
                   parent = TtaGetExactTypedAncestor (selElem, elType);  
                 }  
               if (parent == NULL)                if (parent == NULL)
                 return;                  return;
                 elType.ElSSchema = sstempl;
               elType.ElTypeNum = Template_EL_component;                elType.ElTypeNum = Template_EL_component;
               prev = TtaGetExactTypedAncestor (selElem, elType);                prev = TtaGetExactTypedAncestor (selElem, elType);
             }              }
Line 2436  void TemplateCreateUnion (Document doc, Line 2431  void TemplateCreateUnion (Document doc,
           if (QueryUnionFromUser(proposed, NULL, &name, &types, TRUE))            if (QueryUnionFromUser(proposed, NULL, &name, &types, TRUE))
             {              {
               TtaOpenUndoSequence (doc, NULL, NULL, 0, 0);                TtaOpenUndoSequence (doc, NULL, NULL, 0, 0);
   
               head = TemplateFindHead(doc);                head = TemplateFindHead(doc);
               sibling = TtaGetLastChild(head);                sibling = TtaGetLastChild(head);
   
               unionType.ElSSchema = sstempl;                unionType.ElSSchema = sstempl;
               unionType.ElTypeNum = Template_EL_union;                unionType.ElTypeNum = Template_EL_union;
               unionEl = TtaNewElement(doc, unionType);                unionEl = TtaNewElement(doc, unionType);
Line 2929  Element Template_CreateUseFromSelection Line 2922  Element Template_CreateUseFromSelection
                     TtaInsertFirstChild (&comp, parent, doc);                      TtaInsertFirstChild (&comp, parent, doc);
                   SetAttributeStringValue (comp, Template_ATTR_name, buffer);                    SetAttributeStringValue (comp, Template_ATTR_name, buffer);
                   // generate a content                    // generate a content
                   selElem = TtaGetFirstChild (comp);                    selElem = Template_FillEmpty (comp, doc);
                   if (selElem == NULL)  
                     {  
                       selType.ElSSchema = sstempl;  
                       selType.ElTypeNum = Template_EL_TemplateObject;  
                       selElem = TtaNewElement (doc, selType);  
                     TtaInsertFirstChild (&selElem, comp, doc);  
                     }  
                   TtaRegisterElementCreate (comp, doc);                    TtaRegisterElementCreate (comp, doc);
                   TtaSelectElement (doc, selElem);                    TtaSelectElement (doc, selElem);
                   // register document modification                    // register document modification

Removed from v.1.244  
changed lines
  Added in v.1.245


Webmaster