diff --git a/Linux-x86_64/liboffice_plugin.so b/Linux-x86_64/liboffice_plugin.so index a3aaba9..fb424b1 100644 Binary files a/Linux-x86_64/liboffice_plugin.so and b/Linux-x86_64/liboffice_plugin.so differ diff --git a/funcext/TSOffice/TOfficeObj.tsf b/funcext/TSOffice/TOfficeObj.tsf index 60a18f7..4f85ff3 100644 --- a/funcext/TSOffice/TOfficeObj.tsf +++ b/funcext/TSOffice/TOfficeObj.tsf @@ -1,4 +1,4 @@ -// Version 1.4.3 +// Version 1.4.4 Function TOfficeObj(n); Begin @@ -13008,10 +13008,15 @@ Type TDocumentBody = Class(DocObject) End; if not ifObj(node) then return false; + reset_position := false; + if node = TOfficeApi().GetCurrentPosition() then + reset_position := true; next := node.NextElement('w:p'); node_.DeleteChild(node); if not ifObj(next) then _setLastParagraph(); + if reset_position then + TOfficeApi().Set('CurrentPosition', lastParagraph_); return true; End; diff --git a/funcext/TSOffice/TSDocxFile.tsf b/funcext/TSOffice/TSDocxFile.tsf index 5cd7506..ca72dc0 100644 --- a/funcext/TSOffice/TSDocxFile.tsf +++ b/funcext/TSOffice/TSDocxFile.tsf @@ -1,4 +1,4 @@ -// Version 1.4.3 +// Version 1.4.4 Type TSDocxFile = Class ///Version: V1.0 2022-09-20 diff --git a/funcext/TSOffice/TSExcelFile.tsf b/funcext/TSOffice/TSExcelFile.tsf index 5102674..4dbce57 100644 --- a/funcext/TSOffice/TSExcelFile.tsf +++ b/funcext/TSOffice/TSExcelFile.tsf @@ -1,4 +1,4 @@ -// Version 1.4.3 +// Version 1.4.4 Type TSExcelFile = Class ///Version: V1.0 2022-08-08 diff --git a/funcext/TSOffice/document/TDocxCopy.tsf b/funcext/TSOffice/document/TDocxCopy.tsf index 0035700..f26bb21 100644 --- a/funcext/TSOffice/document/TDocxCopy.tsf +++ b/funcext/TSOffice/document/TDocxCopy.tsf @@ -78,10 +78,10 @@ private Function DeleteComment(paragraph); Begin - node := paragraph.node_.FirstChildElement('w:commentRangeStart'); + node := paragraph.node_.FirstChildElement('w:commentRangeStart'); while ifObj(node) do begin - name := node.GetName(); + name := node.GetName(); if name = "w:commentRangeStart" or name = "w:commentRangeEnd" then begin delete_node := node; @@ -188,7 +188,7 @@ private while fileName in files do begin if ret then - fileName := result[0][1] $ result[0][2] $ "tinysoft" $ count $ result[0][3]; + fileName := result[0][1] $ result[0][2] $ "tinysoft" $ count $ result[0][3]; else fileName := fileName $ "tinysoft" $ count; count++; end @@ -222,7 +222,7 @@ private begin id := numpr.GetAttribute('w:val'); numberid := number_copy_obj_.CopyNumbering(id); - numpr.SetAttribute('w:val', id); + numpr.SetAttribute('w:val', id); end DeleteComment(paragraph); // 删除批注 End; @@ -243,7 +243,7 @@ private for c:=1 to col do begin cell := table.Cell(r, c); - if not cell then continue; + if not cell then continue; node := cell.node_; if (tbl := node.FirstChildElement('w:tbl')) then begin @@ -321,7 +321,7 @@ Type TDocxStyleCopy = class begin new_obj := obj; id_map_[id] := new_obj; - SetId(new_obj, id); + SetId(new_obj, id); SetName(new_obj); end End; @@ -426,7 +426,6 @@ Type TDocxNumberCopy = class old_number_obj_ := nil; new_number_obj_ := nil; end - number_id_map_ := array(); id_map_ := array(); End; @@ -434,9 +433,12 @@ Type TDocxNumberCopy = class Begin if ifObj(old_number_obj_) and ifObj(new_number_obj_) then begin - if (obj := new_number_obj_.NumberStyle(number)) then + if (obj := new_number_obj_.NumberStyle(number)) and not id_map_[number] then begin - return old_number_obj_.CopyNumber(obj); + println("id = {}", number); + number_obj := old_number_obj_.CopyNumber(obj); + id_map_[number] := number_obj; + return number_obj; end end; End; diff --git a/funcext/TSOffice/document/TDocxStyles.tsf b/funcext/TSOffice/document/TDocxStyles.tsf index 3a58155..7dfd141 100644 --- a/funcext/TSOffice/document/TDocxStyles.tsf +++ b/funcext/TSOffice/document/TDocxStyles.tsf @@ -52,7 +52,7 @@ Type TDocxStyles = Class ///返回:TDocxStyle对象 Function GetStyle(name); Begin - return nameMap_[ lowercase(name) ]; + return nameMap_[ class(TSXml).CurCodePageToUtf8(lowercase(name)) ]; End; ///返回指定StyleId名称的TDocxStyle diff --git a/funcext/TSOffice/document/TNumbering.tsf b/funcext/TSOffice/document/TNumbering.tsf index 0b2206c..f9c1d76 100644 --- a/funcext/TSOffice/document/TNumbering.tsf +++ b/funcext/TSOffice/document/TNumbering.tsf @@ -165,7 +165,11 @@ Type TNumbering = Class Begin if ifObj(o) then Begin o.abstractNumId := maxAbstractNumId_++; - if flag then marshal := o.node_.Marshal()[0]; + if flag then + begin + o.node_.SetAttribute('w:abstractNumId', o.abstractNumId); + marshal := o.node_.Marshal()[0]; + end else marshal := o.Marshal(); if ifObj(lastAbstractNumStyle_) then node := numberingXml_.FirstChildElement('w:numbering').InsertAfterChild(lastAbstractNumStyle_, marshal); diff --git a/funcext/TSOffice/document/TTableContent.tsf b/funcext/TSOffice/document/TTableContent.tsf index 4fbe47f..9d45b46 100644 --- a/funcext/TSOffice/document/TTableContent.tsf +++ b/funcext/TSOffice/document/TTableContent.tsf @@ -160,8 +160,9 @@ Type TTableContent = class if ifObj(style) then numStr := style.GetText(r[i]['ilvl'], r[i]['numArr']); End - if numStr <> '' then r1.T := numStr + ' ' + r[i]['Text']; - else r1.T := r[i]['Text']; + if numStr <> '' then run_t := numStr + ' ' + r[i]['Text']; + else run_t := r[i]['Text']; + r1.SetText(run_t); r2 := h.AddRun(); r2.rPr.noProof := true; diff --git a/更新日志.md b/更新日志.md index 98b7f91..1e8ec34 100644 --- a/更新日志.md +++ b/更新日志.md @@ -1,5 +1,15 @@ # 更新日志 +## 2023-8-28 + +### V1.4.4 + +#### word + +1. 修复`insertFile`样式错误问题 +2. 修复`insertFile`后删除段落再新增段落位置错误问题 +3. 修复生成目录中文编码未转换导致word打开失败问题 + ## 2023-8-22 ### V1.4.3