This commit is contained in:
csh 2023-08-29 15:05:06 +08:00
parent e2e68efc30
commit 3643be6231
3 changed files with 7 additions and 16 deletions

View File

@ -13558,14 +13558,9 @@ 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';
if code <> '' then errArr[ length(errArr) ] := array('code':code, 'err':err);
str := eval(&code);
except
println('run code={},err={}', code, ExceptObject.ErrInfo);
errArr[ length(errArr) ] := array('code':code, 'err':ExceptObject.ErrInfo);
str := '';
End; End;
tslFuncCount ++; tslFuncCount ++;
tNode := curRun.node_.FirstChildElement('w:t'); tNode := curRun.node_.FirstChildElement('w:t');

View File

@ -0,0 +1,4 @@
Function _WordSetCurrentRange(range);
Begin
TOfficeApi().Set('CurrentPosition', range);
End;

View File

@ -1147,14 +1147,6 @@ Type xlsxWorkBook = Class
Function ProtectSheet(sheet, protect); Function ProtectSheet(sheet, protect);
Begin Begin
if protect.AlgorithmName and protect.Password then
begin
protect.SaltValue := nil;//protect.Password;
protect.HashValue := nil;//GetMsgDigest(protect.SaltValue, 6);
protect.SpinCount := nil;
protect.Password := nil;
protect.AlgorithmName := nil;
end
sheet_obj := GetSheetXmlfile(sheet); sheet_obj := GetSheetXmlfile(sheet);
work_node := sheet_obj.FirstChildElement('worksheet'); work_node := sheet_obj.FirstChildElement('worksheet');
sheet_protection_node := work_node.FirstChildElement('sheetProtection'); sheet_protection_node := work_node.FirstChildElement('sheetProtection');