Diff for /Amaya/amaya/templates.c between versions 1.146 and 1.147

version 1.146, 2007/06/22 14:17:09 version 1.147, 2007/06/27 15:30:19
Line 1515  ThotBool TemplateElementWillBeCreated (N Line 1515  ThotBool TemplateElementWillBeCreated (N
     return FALSE; // let Thot do the job      return FALSE; // let Thot do the job
   
   // Fisrt, test if in a xt:bag or in a base-element xt:use    // Fisrt, test if in a xt:bag or in a base-element xt:use
   if(parentType.ElSSchema==templateSSchema)    if(parentType.ElSSchema == templateSSchema)
     ancestor = parent;      ancestor = parent;
   else    else
     ancestor = GetFirstTemplateParentElement(parent);      ancestor = GetFirstTemplateParentElement (parent);
   
   if(ancestor)    if (ancestor)
   {    {
     ancestorType = TtaGetElementType(ancestor);      ancestorType = TtaGetElementType(ancestor);
   
     if(ancestorType.ElTypeNum==Template_EL_bag)      if (ancestorType.ElTypeNum == Template_EL_bag)
     {      {
       if(elType.ElSSchema==templateSSchema &&        // only check the use child
           (elType.ElTypeNum==Template_EL_useSimple || elType.ElTypeNum==Template_EL_useEl))        if (ancestor != parent)
           return  FALSE; // let Thot do the job
         if (elType.ElSSchema == templateSSchema &&
             (elType.ElTypeNum == Template_EL_useSimple ||
              elType.ElTypeNum == Template_EL_useEl))
         return FALSE;          return FALSE;
       return !Template_CanInsertElementInBagElement(event->document, elType, ancestor);              return !Template_CanInsertElementInBagElement (event->document, elType, ancestor);      
     }      }
     else if(ancestorType.ElTypeNum==Template_EL_useSimple ||      else if(ancestorType.ElTypeNum == Template_EL_useSimple ||
             ancestorType.ElTypeNum==Template_EL_useEl)              ancestorType.ElTypeNum == Template_EL_useEl)
     {      {
       // only check the use child        // only check the bag child @@@ will be check exclude/include later
       if (ancestor != parent)        if (ancestor != parent)
         return  FALSE; // let Thot do the job          return  FALSE; // let Thot do the job
       types = GetAttributeStringValueFromNum(ancestor, Template_ATTR_currentType, NULL);        types = GetAttributeStringValueFromNum(ancestor, Template_ATTR_currentType, NULL);
Line 1545  ThotBool TemplateElementWillBeCreated (N Line 1549  ThotBool TemplateElementWillBeCreated (N
     }      }
   }    }
       
   if(elType.ElSSchema==templateSSchema && elType.ElTypeNum==Template_EL_TEXT_UNIT)    if (elType.ElSSchema == templateSSchema && elType.ElTypeNum == Template_EL_TEXT_UNIT)
   {    {
     return FALSE;      return FALSE;
   }    }

Removed from v.1.146  
changed lines
  Added in v.1.147


Webmaster