This commit is contained in:
csh 2023-06-26 11:08:48 +08:00
parent c706d2d8d0
commit ce331f4417
5 changed files with 34 additions and 11 deletions

View File

@ -1,4 +1,4 @@
// Version 1.3.2 // Version 1.3.3
Function TOfficeObj(n); Function TOfficeObj(n);
Begin Begin
@ -13279,6 +13279,19 @@ Type TDocumentBody = Class(DocObject)
return array(length(errArr), tslFuncCount, errArr); return array(length(errArr), tslFuncCount, errArr);
End; End;
Function RunTslCode(code, err);
Begin
try
//println('run code=[{}]', code);
if code <> '' then
eval(&code);
except
err := ExceptObject.ErrInfo;
return false;
End;
return true;
End;
Function ExecInnerTSLImpl(docx); Function ExecInnerTSLImpl(docx);
Begin Begin
tslFuncCount := 0; tslFuncCount := 0;
@ -13410,15 +13423,11 @@ Type TDocumentBody = Class(DocObject)
TOfficeApi().Set('CurrentPosition', tslBegParagraphNode); TOfficeApi().Set('CurrentPosition', tslBegParagraphNode);
TOfficeApi().Set('CurrentRun', curRunNode); TOfficeApi().Set('CurrentRun', curRunNode);
TOfficeApi().Set('CodePage', 'gbk'); TOfficeApi().Set('CodePage', 'gbk');
try if not RunTslCode(code, err) then Begin
tslFuncCount ++; echo 'run code=',code,',err=', err, '\n';
echo format('run code=[%s]\n',code); errArr[ length(errArr) ] := array('code':code, 'err':err);
if code <> '' then
eval(&code);
except
echo format('run code=%s,err=%s\n', code, ExceptObject.ErrInfo);
errArr[ length(errArr) ] := array('code':code, 'err':ExceptObject.ErrInfo);
End; End;
tslFuncCount ++;
tNode := curRun.node_.FirstChildElement('w:t'); tNode := curRun.node_.FirstChildElement('w:t');
if not ifObj(tNode) then Begin //没有在外部插入文字 if not ifObj(tNode) then Begin //没有在外部插入文字
tslBegParagraphNode.DeleteChild(curRunNode); tslBegParagraphNode.DeleteChild(curRunNode);

View File

@ -1,4 +1,4 @@
// Version 1.3.2 // Version 1.3.3
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.3.2 // Version 1.3.3
Type TSExcelFile = Class Type TSExcelFile = Class
///Version: V1.0 2022-08-08 ///Version: V1.0 2022-08-08

View File

@ -0,0 +1,4 @@
Function TOfficeInit();
Begin
sysparams['TOffice sys api'] := nil;
End;

View File

@ -1,5 +1,15 @@
# 更新日志 # 更新日志
## 2023-6-26
### V1.3.2
修复.net使用rdo2执行失败问题使用rdo2时候需调用`TOfficeInit()`初始化
#### word
1. 修复word模板`template.docx`执行失败问题
## 2023-6-20 ## 2023-6-20
更新部署方式,不再依赖`fmt_pubkrnl_plugin.dll`,详情见[README](./README.md) 更新部署方式,不再依赖`fmt_pubkrnl_plugin.dll`,详情见[README](./README.md)