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
+18 -9
View File
@@ -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);
+1 -1
View File
@@ -1,4 +1,4 @@
// Version 1.3.2
// Version 1.3.3
Type TSDocxFile = Class
///Version: V1.0 2022-09-20
+1 -1
View File
@@ -1,4 +1,4 @@
// Version 1.3.2
// Version 1.3.3
Type TSExcelFile = Class
///Version: V1.0 2022-08-08
+4
View File
@@ -0,0 +1,4 @@
Function TOfficeInit();
Begin
sysparams['TOffice sys api'] := nil;
End;