diff --git a/funcext/TSOffice/TOfficeObj.tsf b/funcext/TSOffice/TOfficeObj.tsf index e97d0fe..3b144b5 100644 --- a/funcext/TSOffice/TOfficeObj.tsf +++ b/funcext/TSOffice/TOfficeObj.tsf @@ -1,4 +1,4 @@ -// Version 1.7.1 +// Version 1.7.2 Function TOfficeObj(n); Begin case lowercase(n) of @@ -14033,7 +14033,8 @@ Type TDocumentBody = Class(DocObject) End; end End - else if false and ifarray(numIds) and name = 'w:tbl' then Begin + else if TOfficeApi().Get('CELLFLAG') and ifarray(numIds) and name = 'w:tbl' then Begin + println("enter..."); tbl := TOfficeObj('TTable'); tbl.Init(pNode); rows := tbl.Rows(); @@ -14041,7 +14042,17 @@ Type TDocumentBody = Class(DocObject) for i:=1 to rows do Begin for j:=1 to cols do Begin cell := tbl.Cell(i, j); - if cell then [a, b] := cell.GetHeadingListImpl(docx, nil, UpperHeadingLevel, LowerHeadingLevel, numIds);//表格内递归查找,统计数字项目编号,但不显示在大纲中 + if cell then arr := cell.GetHeadingListImpl(docx, nil, UpperHeadingLevel, LowerHeadingLevel, numIds);//表格内递归查找,统计数字项目编号,但不显示在大纲中 + for ii:=0 to length(arr)-1 do + begin + r[ind]['Level'] := arr[ii]['Level']; + r[ind]['Paragraph'] := arr[ii]['Paragraph']; + r[ind]['Text'] := arr[ii]['Text']; + r[ind]['numId'] := arr[ii]['numId']; + r[ind]['ilvl'] := arr[ii]['ilvl']; + r[ind]['numArr'] := arr[ii]['numArr']; + ind++ + end End; End; End; diff --git a/funcext/TSOffice/TSDocxFile.tsf b/funcext/TSOffice/TSDocxFile.tsf index 9ea9f78..49a842b 100644 --- a/funcext/TSOffice/TSDocxFile.tsf +++ b/funcext/TSOffice/TSDocxFile.tsf @@ -1,4 +1,4 @@ -// Version 1.7.1 +// Version 1.7.2 Type TSDocxFile = Class ///Version: V1.0 2022-09-20 ///适用于 Microsoft Word docx格式文件 diff --git a/funcext/TSOffice/TSUtils/TOfficeApi.tsf b/funcext/TSOffice/TSUtils/TOfficeApi.tsf index fa41a7f..7061d80 100644 --- a/funcext/TSOffice/TSUtils/TOfficeApi.tsf +++ b/funcext/TSOffice/TSUtils/TOfficeApi.tsf @@ -199,6 +199,12 @@ Type TOffice = Class return -1; end; End; + + ///单元格内的标题是否添加到目录 + Function SetCellTableContent(flag); + Begin + hash_["CELLFLAG"] := flag; + End; Function Set(k, v); Begin diff --git a/funcext/TSOffice/TSXlsxFile.tsf b/funcext/TSOffice/TSXlsxFile.tsf index b54557c..58bf011 100644 --- a/funcext/TSOffice/TSXlsxFile.tsf +++ b/funcext/TSOffice/TSXlsxFile.tsf @@ -1,4 +1,4 @@ -// Version 1.7.1 +// Version 1.7.2 Type TSXlsxFile = Class ///Version: V1.0 2022-08-08 ///适用于 Microsoft Excel? 2007 及以上版本创建的电子表格文档。支持 XLSX / XLSM / XLTM / XLTX 等多种文档格式。 diff --git a/funcext/TSOffice/document/TTableContent.tsf b/funcext/TSOffice/document/TTableContent.tsf index 3a48c9d..db9de25 100644 --- a/funcext/TSOffice/document/TTableContent.tsf +++ b/funcext/TSOffice/document/TTableContent.tsf @@ -118,13 +118,13 @@ Type TTableContent = class tab := TOfficeObj('TTabStop'); tab.Val := 'right'; tab.leader := 'dot'; - tab.Position := 9628; + tab.Position := 8306; p.Format.Tabs.Add(0, tab); if first then Begin //fldCharType r1 := p.AddRun(); r1.fldCharType := 'begin'; - r1.Dirty := 'true'; + r1.Dirty := 0; //instrText r2 := p.AddRun(); diff --git a/更新日志.md b/更新日志.md index d64a6fd..0388387 100644 --- a/更新日志.md +++ b/更新日志.md @@ -1,5 +1,13 @@ # 更新日志 +## 2024-12-04 + +### V1.7.2 + +#### word + +1. 支持单元格标题生成到目录,需要额外设置`TOfficeApi().SetCellTableContent(true);`,默认是`false` + ## 2024-11-19 ### V1.7.1