Diff for /Amaya/amaya/HTMLbook.c between versions 1.162 and 1.163

version 1.162, 2009/09/07 16:03:05 version 1.163, 2009/10/15 15:07:36
Line 1815  void MakeToc (Document doc, View view) Line 1815  void MakeToc (Document doc, View view)
   DisplayMode         dispMode;    DisplayMode         dispMode;
   char               *s, *id, *value;    char               *s, *id, *value;
   int                 firstChar, i;    int                 firstChar, i;
   ThotBool            closeUndo, found, manyH1;    ThotBool            closeUndo, found, manyH1, extendUndo;
   
   dispMode = TtaGetDisplayMode (doc);    dispMode = TtaGetDisplayMode (doc);
   
Line 1847  void MakeToc (Document doc, View view) Line 1847  void MakeToc (Document doc, View view)
       if (strcmp (s, "HTML"))        if (strcmp (s, "HTML"))
         return;          return;
     }      }
     if (!TtaIsSelectionEmpty())
       {
         TtaInsertAnyElement (doc, TRUE);
         extendUndo = TRUE;
       }
     else
        extendUndo = FALSE;
   if (!HTMLelementAllowed (doc))    if (!HTMLelementAllowed (doc))
     /* the creation of an HTML element is not allowed here */      /* the creation of an HTML element is not allowed here */
     return;      return;
Line 1859  void MakeToc (Document doc, View view) Line 1865  void MakeToc (Document doc, View view)
   if (lH1)    if (lH1)
     {      {
       if (TtaSearchTypedElement (elType, SearchForward, lH1))        if (TtaSearchTypedElement (elType, SearchForward, lH1))
         /* there are at least 2 H1 elements in the document */          /* there are at least 2 H1 elements in the document */
         manyH1 = TRUE;          manyH1 = TRUE;
     }      }
   
   attrType.AttrSSchema = elType.ElSSchema;    attrType.AttrSSchema = elType.ElSSchema;
Line 1925  void MakeToc (Document doc, View view) Line 1931  void MakeToc (Document doc, View view)
   else    else
     {      {
       closeUndo = TRUE;        closeUndo = TRUE;
       TtaOpenUndoSequence (doc, NULL, NULL, 0, 0);        if (extendUndo)
           TtaExtendUndoSequence (doc);
         else
           TtaOpenUndoSequence (doc, NULL, NULL, 0, 0);
     }      }
   
   if (toc)    if (toc)

Removed from v.1.162  
changed lines
  Added in v.1.163


Webmaster