This commit is contained in:
csh
2026-09-10 15:03:04 +08:00
parent 3df8ce2be0
commit 19b8614c93
5 changed files with 37 additions and 5 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
// Version 1.8.7
// Version 1.8.8
Function TOfficeObj(n);
Begin
case lowercase(n) of
+1 -1
View File
@@ -1,4 +1,4 @@
// Version 1.8.7
// Version 1.8.8
Type TSDocxFile = Class
///Version: V1.0 2022-09-20
///适用于 Microsoft Word docx格式文件
+1 -1
View File
@@ -1,4 +1,4 @@
// Version 1.8.7
// Version 1.8.8
Type TSXlsxFile = Class
///Version: V1.0 2022-08-08
///适用于 Microsoft Excel? 2007 及以上版本创建的电子表格文档。支持 XLSX / XLSM / XLTM / XLTX 等多种文档格式。
+26 -2
View File
@@ -249,7 +249,9 @@ private
Function SetDrawingInfo(drawing);
Begin
graphic_node := class(TSXml).GetNode(drawing.node_,'w:r/w:drawing/wp:inline/a:graphic/a:graphicData');
drawing_node := GetDrawingNode(drawing.node_);
graphic_node := class(TSXml).GetNode(drawing_node,'wp:inline/a:graphic/a:graphicData');
// graphic_node := class(TSXml).GetNode(drawing.node_,'w:r/w:drawing/wp:inline/a:graphic/a:graphicData');
if ifObj(graphic_node) then
begin
node := class(TSXml).GetNode(graphic_node,'pic:pic/pic:blipFill/a:blip');
@@ -353,7 +355,8 @@ private
end
else if name = "w:p" then
begin
draw := class(TSXml).GetNode(node, 'w:r/w:drawing');
// draw := class(TSXml).GetNode(node, 'w:r/w:drawing');
draw := GetDrawingNode(node);
if ifObj(draw) then
begin
obj := TOfficeObj('TPicture');
@@ -382,6 +385,7 @@ private
case name of
'w:p':
begin
if GetDrawingNode(part.node_) then return 1;
if class(TSXml).GetNode(part.node_, 'w:r/w:drawing') then return 1;
return 0;
end
@@ -392,6 +396,26 @@ private
end
End;
function GetDrawingNode(node);
begin
r_node := node.FirstChild('w:r');
while ifObj(r_node) do
begin
sub_node := r_node.FirstChild();
sub_node_name := sub_node.GetName();
if sub_node_name = 'w:rPr' then
begin
sub_node := sub_node.NextElement();
sub_node_name := sub_node.GetName();
end
if sub_node_name = 'w:drawing' then return sub_node;
if sub_node_name = 'w:t' and sub_node.GetAttribute('xml:space') = 'preserve' then
r_node := r_node.NextElement();
else break;
end
return nil;
end;
private
old_docx_obj_;
new_docx_obj_;