From e105a205be569ef7e3e8e9d578c4616a871d0405 Mon Sep 17 00:00:00 2001 From: csh Date: Fri, 15 Mar 2024 10:22:51 +0800 Subject: [PATCH] v1.6.6-patch2 --- funcext/TSOffice/TSUtils/TSXml.tsf | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/funcext/TSOffice/TSUtils/TSXml.tsf b/funcext/TSOffice/TSUtils/TSXml.tsf index 01be3a3..de6e6c2 100644 --- a/funcext/TSOffice/TSUtils/TSXml.tsf +++ b/funcext/TSOffice/TSUtils/TSXml.tsf @@ -377,6 +377,27 @@ Type TSXml = Class return TOfficeApi().CurCodePageToUtf8(str); End; + // 获取docx的类型 + // 普通段落:0 + // 图片段落:1 + // 表格:2 + // 其他:-1 + class Function GetDocxPartType(part); + Begin + if not ifObj(part) then return -1; + case part.name_ of + 'w:p': + begin + if class(TSXml).GetNode(part.node_, 'w:r/w:drawing') then return 1; + return 0; + end + 'w:tbl': + return 2; + else + return -1; + end; + End; + //字体属性 class Function ReadRprFormat(node); Begin