diff --git a/funcext/TSOffice/TOfficeObj.tsf b/funcext/TSOffice/TOfficeObj.tsf index 5015631..a71bae0 100644 --- a/funcext/TSOffice/TOfficeObj.tsf +++ b/funcext/TSOffice/TOfficeObj.tsf @@ -1,4 +1,4 @@ -// Version 1.3.2 +// Version 1.3.3 Function TOfficeObj(n); Begin @@ -13279,6 +13279,19 @@ Type TDocumentBody = Class(DocObject) return array(length(errArr), tslFuncCount, errArr); 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); Begin tslFuncCount := 0; @@ -13410,15 +13423,11 @@ Type TDocumentBody = Class(DocObject) TOfficeApi().Set('CurrentPosition', tslBegParagraphNode); TOfficeApi().Set('CurrentRun', curRunNode); TOfficeApi().Set('CodePage', 'gbk'); - try - tslFuncCount ++; - echo format('run code=[%s]\n',code); - 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); + if not RunTslCode(code, err) then Begin + echo 'run code=',code,',err=', err, '\n'; + errArr[ length(errArr) ] := array('code':code, 'err':err); End; + tslFuncCount ++; tNode := curRun.node_.FirstChildElement('w:t'); if not ifObj(tNode) then Begin //没有在外部插入文字 tslBegParagraphNode.DeleteChild(curRunNode); diff --git a/funcext/TSOffice/TSDocxFile.tsf b/funcext/TSOffice/TSDocxFile.tsf index 62f3748..92317c3 100644 --- a/funcext/TSOffice/TSDocxFile.tsf +++ b/funcext/TSOffice/TSDocxFile.tsf @@ -1,4 +1,4 @@ -// Version 1.3.2 +// Version 1.3.3 Type TSDocxFile = Class ///Version: V1.0 2022-09-20 diff --git a/funcext/TSOffice/TSExcelFile.tsf b/funcext/TSOffice/TSExcelFile.tsf index 4c1f283..9389f3e 100644 --- a/funcext/TSOffice/TSExcelFile.tsf +++ b/funcext/TSOffice/TSExcelFile.tsf @@ -1,4 +1,4 @@ -// Version 1.3.2 +// Version 1.3.3 Type TSExcelFile = Class ///Version: V1.0 2022-08-08 diff --git a/funcext/TSOffice/TSUtils/TOfficeInit.tsf b/funcext/TSOffice/TSUtils/TOfficeInit.tsf new file mode 100644 index 0000000..b313b2d --- /dev/null +++ b/funcext/TSOffice/TSUtils/TOfficeInit.tsf @@ -0,0 +1,4 @@ +Function TOfficeInit(); +Begin + sysparams['TOffice sys api'] := nil; +End; diff --git a/更新日志.md b/更新日志.md index ac3b9a3..52d085b 100644 --- a/更新日志.md +++ b/更新日志.md @@ -1,5 +1,15 @@ # 更新日志 +## 2023-6-26 + +### V1.3.2 + +修复.net使用rdo2执行失败问题,使用rdo2时候,需调用`TOfficeInit()`初始化 + +#### word + +1. 修复word模板`template.docx`执行失败问题 + ## 2023-6-20 更新部署方式,不再依赖`fmt_pubkrnl_plugin.dll`,详情见[README](./README.md)