This commit is contained in:
csh 2025-12-15 13:28:02 +08:00
parent ea528f3094
commit bbe0821f68
6 changed files with 617 additions and 602 deletions

View File

@ -1,4 +1,4 @@
// Version 1.8.4
// Version 1.8.5
Function TOfficeObj(n);
Begin
case lowercase(n) of

View File

@ -1,4 +1,4 @@
// Version 1.8.4
// Version 1.8.5
Type TSDocxFile = Class
///Version: V1.0 2022-09-20
///适用于 Microsoft Word docx格式文件

View File

@ -1,4 +1,4 @@
// Version 1.8.4
// Version 1.8.5
Type TSXlsxFile = Class
///Version: V1.0 2022-08-08
///适用于 Microsoft Excel? 2007 及以上版本创建的电子表格文档。支持 XLSX / XLSM / XLTM / XLTX 等多种文档格式。

View File

@ -341,28 +341,33 @@ private
begin
cell := table.Cell(r, c);
if not cell then continue;
node := cell.node_;
if (tbl := node.FirstChildElement('w:tbl')) then
node := cell.node_.FirstChildElement();
while ifObj(node) do
begin
name := node.GetName();
if name = 'w:tbl' then
begin
obj := TOfficeObj('TTable');
obj.Init(tbl);
obj.Init(node);
SetTableInfo(obj);
end
else if (p := node.FirstChildElement('w:p')) then
else if name = "w:p" then
begin
draw := class(TSXml).GetNode(p, 'w:r/w:drawing');
draw := class(TSXml).GetNode(node, 'w:r/w:drawing');
if ifObj(draw) then
begin
obj := TOfficeObj('TPicture');
obj.Init(p);
obj.Init(node);
SetDrawingInfo(obj);
end
else begin
obj := TOfficeObj('TParagraph');
obj.Init(p);
obj.Init(node);
SetParagraphInfo(obj);
end
end
node := node.NextElement();
end
end
end
End;

View File

@ -994,7 +994,7 @@ Type xlsxWorkBook = Class
col_node := work_node.FirstChildElement('cols');
default_width := work_node.FirstChildElement('sheetFormatPr').GetAttribute('defaultColWidth');
default_width := trystrtofloat(default_width, r) ? r: -1;
if not ifObj(col_node) then return array(0, default_width);
if not ifObj(col_node) then return nil;
col_number := ColumnNameToNumber(col)[1];
node := col_node.FirstChildElement('col');

View File

@ -1,5 +1,15 @@
# 更新日志
## 2025-12-15
#### word
1. 修复插入word时单元格内容不完整问题
#### excel
1. 修复`GetColWithd`返回值出现数组问题,没有设置宽度返回`nil`
## 2025-11-07
### V1.8.4