Diff for /Amaya/amaya/HTMLbook.c between versions 1.156 and 1.157

version 1.156, 2007/12/07 13:31:40 version 1.157, 2008/01/07 14:34:09
Line 1 Line 1
 /*  /*
  *   *
  *  (c) COPYRIGHT INRIA and W3C, 1996-2007   *  (c) COPYRIGHT INRIA and W3C, 1996-2008
  *  Please first read the full copyright statement in file COPYRIGHT.   *  Please first read the full copyright statement in file COPYRIGHT.
  *   *
  */   */
Line 1847  void MakeToc (Document doc, View view) Line 1847  void MakeToc (Document doc, View view)
             {              {
               /* generate the enclosing division */                /* generate the enclosing division */
               elType.ElTypeNum = HTML_EL_Division;                elType.ElTypeNum = HTML_EL_Division;
               TtaInsertElement (elType, doc);                if (TtaInsertElement (elType, doc))
               TtaGiveFirstSelectedElement (doc, &child, &firstChar, &i);  
               if (child != ancest)  
                 {                  {
                     TtaGiveFirstSelectedElement (doc, &child, &firstChar, &i);
                   /* the div and its initial content is now created */                    /* the div and its initial content is now created */
                   toc = TtaGetTypedAncestor (child, elType);                    toc = TtaGetTypedAncestor (child, elType);
                   TtaRegisterElementDelete (child, doc);                    TtaRegisterElementDelete (child, doc);
Line 1858  void MakeToc (Document doc, View view) Line 1857  void MakeToc (Document doc, View view)
                 }                  }
               else                else
                 {                  {
                     // the division is not created
                   if (closeUndo)                    if (closeUndo)
                     TtaCloseUndoSequence (doc);                      TtaCloseUndoSequence (doc);
                   if (dispMode == DisplayImmediately)                    if (dispMode == DisplayImmediately)
Line 1865  void MakeToc (Document doc, View view) Line 1865  void MakeToc (Document doc, View view)
                   TtaDisplaySimpleMessage (CONFIRM, AMAYA, AM_NOT_ALLOWED);                    TtaDisplaySimpleMessage (CONFIRM, AMAYA, AM_NOT_ALLOWED);
                   return;                    return;
                 }                  }
   
               if (toc)                if (toc)
                 {                  {
                   /* it's the last created element */                    /* it's the last created element */
Line 1875  void MakeToc (Document doc, View view) Line 1876  void MakeToc (Document doc, View view)
                   TtaRegisterAttributeCreate (attr, toc, doc);                    TtaRegisterAttributeCreate (attr, toc, doc);
                 }                  }
             }              }
   
           if (toc == NULL)            if (toc == NULL)
             el = NULL;              el = NULL;
           else            else

Removed from v.1.156  
changed lines
  Added in v.1.157


Webmaster