This commit is contained in:
csh 2023-08-30 15:43:03 +08:00
parent ef0dcde062
commit 8aa050461c
7 changed files with 39 additions and 6 deletions

View File

@ -1,4 +1,4 @@
// Version 1.4.4 // Version 1.4.5
Function TOfficeObj(n); Function TOfficeObj(n);
Begin Begin

View File

@ -1,4 +1,4 @@
// Version 1.4.4 // Version 1.4.5
Type TSDocxFile = Class Type TSDocxFile = Class
///Version: V1.0 2022-09-20 ///Version: V1.0 2022-09-20

View File

@ -1,4 +1,4 @@
// Version 1.4.4 // Version 1.4.5
Type TSExcelFile = Class Type TSExcelFile = Class
///Version: V1.0 2022-08-08 ///Version: V1.0 2022-08-08

File diff suppressed because one or more lines are too long

View File

@ -220,6 +220,26 @@ Type TTableContent = class
Function UpdatePageNumbers(); Function UpdatePageNumbers();
Begin Begin
End; End;
Function Paragraphs();
Begin
node := class(TSXml).GetNode(docx_.Document().Body().Node(), 'w:sdt/w:sdtContent');
r := array();
if ifObj(node) then
begin
twbody := TOfficeObj('TwBody');
twbody.Create(nil, 'w:sdtContent');
twbody.InitRootNode(node);
twbody.InitNode(node);
parts := twbody.Paragraphs();
for i:=0 to length(parts)-1 do
begin
r[i] := TOfficeObj('TParagraph');
r[i].Init(parts[i].node_);
end
end
return r;
End;
Function Marshal(); Function Marshal();
Begin Begin
@ -299,3 +319,4 @@ Type TTableContent = class
node_; node_;
impl_; impl_;
End; End;

View File

@ -1106,7 +1106,7 @@ Type xlsxWorkBook = Class
end end
if name = sheet then if name = sheet then
Begin Begin
node.SetAttribute('tabselected', 1); node.SetAttribute('tabSelected', 1);
workbook := GetXmlFileObj('xl/workbook.xml'); workbook := GetXmlFileObj('xl/workbook.xml');
workbook_node := workbook.FirstChildElement('workbook'); workbook_node := workbook.FirstChildElement('workbook');
book_view_node := workbook_node.FirstChildElement('bookViews'); book_view_node := workbook_node.FirstChildElement('bookViews');
@ -1126,7 +1126,7 @@ Type xlsxWorkBook = Class
else else
begin begin
node := root_node.FirstChildElement('sheetViews').FirstChildElement('sheetView'); node := root_node.FirstChildElement('sheetViews').FirstChildElement('sheetView');
node.SetAttribute('tabselected', 0); node.SetAttribute('tabSelected', 0);
end end
end end
End End

View File

@ -1,5 +1,17 @@
# 更新日志 # 更新日志
## 2023-8-30
### V1.4.5
#### word
1. 支持生成目录后返回目录对象的所有段落内容`目录对象.Paragraphs()`
#### excel
1. 修复`NewSheet`excel打开遇到提示错误问题
## 2023-8-28 ## 2023-8-28
### V1.4.4 ### V1.4.4