version 1.114, 2004/09/10 15:04:04
|
version 1.115, 2004/09/10 16:00:07
|
Line 1449 void MakeToc (Document doc, View view)
|
Line 1449 void MakeToc (Document doc, View view)
|
|
|
attrType.AttrSSchema = elType.ElSSchema; |
attrType.AttrSSchema = elType.ElSSchema; |
ulType.ElSSchema = elType.ElSSchema; |
ulType.ElSSchema = elType.ElSSchema; |
ulType.ElTypeNum = HTML_EL_Numbered_List; |
ulType.ElTypeNum = HTML_EL_Unnumbered_List; |
searchedType1.ElSSchema = elType.ElSSchema; |
searchedType1.ElSSchema = elType.ElSSchema; |
searchedType1.ElTypeNum = HTML_EL_H2; |
searchedType1.ElTypeNum = HTML_EL_H2; |
searchedType2.ElSSchema = elType.ElSSchema; |
searchedType2.ElSSchema = elType.ElSSchema; |
Line 1460 void MakeToc (Document doc, View view)
|
Line 1460 void MakeToc (Document doc, View view)
|
searchedType4.ElTypeNum = HTML_EL_H5; |
searchedType4.ElTypeNum = HTML_EL_H5; |
searchedType5.ElSSchema = elType.ElSSchema; |
searchedType5.ElSSchema = elType.ElSSchema; |
searchedType5.ElTypeNum = HTML_EL_H6; |
searchedType5.ElTypeNum = HTML_EL_H6; |
toc = lH2 = lH3 = lH4 = lH5 = lH6 = NULL; |
toc = lH2 = lH3 = lH4 = lH5 = lH6 = prev = NULL; |
list = NULL; |
list = NULL; |
while (el) |
while (el) |
{ |
{ |
Line 1571 void MakeToc (Document doc, View view)
|
Line 1571 void MakeToc (Document doc, View view)
|
TtaInsertSibling (*list, child, FALSE, doc); |
TtaInsertSibling (*list, child, FALSE, doc); |
else |
else |
TtaInsertFirstChild (list, parent, doc); |
TtaInsertFirstChild (list, parent, doc); |
attrType.AttrTypeNum = HTML_ATTR_NumberStyle; |
/*attrType.AttrTypeNum = HTML_ATTR_BulletStyle; |
attr = TtaGetAttribute (el, attrType); |
attr = TtaGetAttribute (el, attrType); |
if (!attr) |
if (!attr) |
{ |
{ |
attr = TtaNewAttribute (attrType); |
attr = TtaNewAttribute (attrType); |
TtaAttachAttribute (*list, attr, doc); |
TtaAttachAttribute (*list, attr, doc); |
} |
} |
TtaSetAttributeValue (attr, HTML_ATTR_NumberStyle_VAL_Arabic_, |
TtaSetAttributeValue (attr, HTML_ATTR_BulletStyle_VAL_disc, |
*list, doc); |
*list, doc);*/ |
TtaRegisterElementCreate (*list, doc); |
TtaRegisterElementCreate (*list, doc); |
} |
} |
/* generate the list item */ |
/* generate the list item */ |
Line 1652 void MakeToc (Document doc, View view)
|
Line 1652 void MakeToc (Document doc, View view)
|
TtaCloseUndoSequence (doc); |
TtaCloseUndoSequence (doc); |
if (dispMode == DisplayImmediately) |
if (dispMode == DisplayImmediately) |
TtaSetDisplayMode (doc, dispMode); |
TtaSetDisplayMode (doc, dispMode); |
|
/* select the end of the toc */ |
|
if (prev) |
|
{ |
|
child = prev; |
|
while (child) |
|
{ |
|
child = TtaGetLastChild (prev); |
|
if (child) |
|
prev = child; |
|
} |
|
elType = TtaGetElementType (prev); |
|
if (elType.ElTypeNum == HTML_EL_TEXT_UNIT) |
|
{ |
|
i = TtaGetElementVolume (prev); |
|
TtaSelectString (doc, prev, i+1, i); |
|
} |
|
else |
|
TtaSelectElement (doc, prev); |
|
} |
} |
} |