v1.8.8
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
// Version 1.8.7
|
// Version 1.8.8
|
||||||
Function TOfficeObj(n);
|
Function TOfficeObj(n);
|
||||||
Begin
|
Begin
|
||||||
case lowercase(n) of
|
case lowercase(n) of
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Version 1.8.7
|
// Version 1.8.8
|
||||||
Type TSDocxFile = Class
|
Type TSDocxFile = Class
|
||||||
///Version: V1.0 2022-09-20
|
///Version: V1.0 2022-09-20
|
||||||
///适用于 Microsoft Word docx格式文件
|
///适用于 Microsoft Word docx格式文件
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Version 1.8.7
|
// Version 1.8.8
|
||||||
Type TSXlsxFile = Class
|
Type TSXlsxFile = Class
|
||||||
///Version: V1.0 2022-08-08
|
///Version: V1.0 2022-08-08
|
||||||
///适用于 Microsoft Excel? 2007 及以上版本创建的电子表格文档。支持 XLSX / XLSM / XLTM / XLTX 等多种文档格式。
|
///适用于 Microsoft Excel? 2007 及以上版本创建的电子表格文档。支持 XLSX / XLSM / XLTM / XLTX 等多种文档格式。
|
||||||
|
|||||||
@@ -249,7 +249,9 @@ private
|
|||||||
|
|
||||||
Function SetDrawingInfo(drawing);
|
Function SetDrawingInfo(drawing);
|
||||||
Begin
|
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
|
if ifObj(graphic_node) then
|
||||||
begin
|
begin
|
||||||
node := class(TSXml).GetNode(graphic_node,'pic:pic/pic:blipFill/a:blip');
|
node := class(TSXml).GetNode(graphic_node,'pic:pic/pic:blipFill/a:blip');
|
||||||
@@ -353,7 +355,8 @@ private
|
|||||||
end
|
end
|
||||||
else if name = "w:p" then
|
else if name = "w:p" then
|
||||||
begin
|
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
|
if ifObj(draw) then
|
||||||
begin
|
begin
|
||||||
obj := TOfficeObj('TPicture');
|
obj := TOfficeObj('TPicture');
|
||||||
@@ -382,6 +385,7 @@ private
|
|||||||
case name of
|
case name of
|
||||||
'w:p':
|
'w:p':
|
||||||
begin
|
begin
|
||||||
|
if GetDrawingNode(part.node_) then return 1;
|
||||||
if class(TSXml).GetNode(part.node_, 'w:r/w:drawing') then return 1;
|
if class(TSXml).GetNode(part.node_, 'w:r/w:drawing') then return 1;
|
||||||
return 0;
|
return 0;
|
||||||
end
|
end
|
||||||
@@ -392,6 +396,26 @@ private
|
|||||||
end
|
end
|
||||||
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
|
private
|
||||||
old_docx_obj_;
|
old_docx_obj_;
|
||||||
new_docx_obj_;
|
new_docx_obj_;
|
||||||
|
|||||||
Reference in New Issue
Block a user