From 2b62e4e1a521a73fe5b20aa8bd7436c80b11e66a Mon Sep 17 00:00:00 2001 From: csh Date: Thu, 30 Oct 2025 15:50:10 +0800 Subject: [PATCH] v1.8.3 --- funcext/TSOffice/TOfficeObj.tsf | 2 +- funcext/TSOffice/TSDocxFile.tsf | 2 +- funcext/TSOffice/TSXlsxFile.tsf | 6 +++--- funcext/TSOffice/worksheet/xlsxWorkBook.tsf | 2 +- 更新日志.md | 16 ++++++++++++++-- 5 files changed, 20 insertions(+), 8 deletions(-) diff --git a/funcext/TSOffice/TOfficeObj.tsf b/funcext/TSOffice/TOfficeObj.tsf index f04cc39..5cc1349 100644 --- a/funcext/TSOffice/TOfficeObj.tsf +++ b/funcext/TSOffice/TOfficeObj.tsf @@ -1,4 +1,4 @@ -// Version 1.8.2 +// Version 1.8.3 Function TOfficeObj(n); Begin case lowercase(n) of diff --git a/funcext/TSOffice/TSDocxFile.tsf b/funcext/TSOffice/TSDocxFile.tsf index 6e23295..6c144df 100644 --- a/funcext/TSOffice/TSDocxFile.tsf +++ b/funcext/TSOffice/TSDocxFile.tsf @@ -1,4 +1,4 @@ -// Version 1.8.2 +// Version 1.8.3 Type TSDocxFile = Class ///Version: V1.0 2022-09-20 ///适用于 Microsoft Word docx格式文件 diff --git a/funcext/TSOffice/TSXlsxFile.tsf b/funcext/TSOffice/TSXlsxFile.tsf index 2524de9..f5efeb8 100644 --- a/funcext/TSOffice/TSXlsxFile.tsf +++ b/funcext/TSOffice/TSXlsxFile.tsf @@ -1,4 +1,4 @@ -// Version 1.8.2 +// Version 1.8.3 Type TSXlsxFile = Class ///Version: V1.0 2022-08-08 ///适用于 Microsoft Excel? 2007 及以上版本创建的电子表格文档。支持 XLSX / XLSM / XLTM / XLTX 等多种文档格式。 @@ -315,14 +315,14 @@ Type TSXlsxFile = Class Begin if not ifarray(data) or length(data)=0 then return array(-1, "Invalid Data."); - if FieldCount(data)=0 then Begin //数据是一维数组 + if mcols(data) = 0 then Begin //数据是一维数组 return SetSheetRow(sheet, axis, data); End; [err, colNum, rowNum] := CellNameToCoordinates(axis); if err then return array(err, colNum); if IncludeHeader then Begin - fields := FieldNames(data); + fields := mcols(data, 1); if IncludeIndex then Begin fields := array("Index") union fields; End; diff --git a/funcext/TSOffice/worksheet/xlsxWorkBook.tsf b/funcext/TSOffice/worksheet/xlsxWorkBook.tsf index 8b63676..d65d40b 100644 --- a/funcext/TSOffice/worksheet/xlsxWorkBook.tsf +++ b/funcext/TSOffice/worksheet/xlsxWorkBook.tsf @@ -178,7 +178,7 @@ Type xlsxWorkBook = Class data := o.Import(topLeft, bottomRight, includeHeader, includeIndex, forceSingle); if not TOfficeApi().IsUtf8() then begin - fields := fieldnames(data); + fields := mcols(data, 1); if ifarray(fields) and length(fields) then begin map := array(); diff --git a/更新日志.md b/更新日志.md index 0f86773..608cb4d 100644 --- a/更新日志.md +++ b/更新日志.md @@ -1,15 +1,27 @@ # 更新日志 +## 2025-10-30 + +### V1.8.3 + +#### word + +1. `setData`移除`fieldNames`依赖 + +#### excel + +1. `InsertTable/GetTable`移除`fieldNames` 依赖 + ## 2025-10-29 ### V1.8.2 -### word +#### word 1. 升级段落判空`Empty` 2. 修复`FileName`总是返回 gbk -### excel +#### excel 1. 修复`CopySheet`依赖的`ReplaceStrByReg`公共方法问题,不再依赖该方法 2. 修复`FileName`总是返回 gbk