diff --git a/funcext/TSOffice/TOfficeObj.tsf b/funcext/TSOffice/TOfficeObj.tsf index 7e48236..166b7b1 100644 --- a/funcext/TSOffice/TOfficeObj.tsf +++ b/funcext/TSOffice/TOfficeObj.tsf @@ -13558,14 +13558,9 @@ Type TDocumentBody = Class(DocObject) TOfficeApi().Set('CurrentPosition', tslBegParagraphNode); TOfficeApi().Set('CurrentRun', curRunNode); TOfficeApi().Set('CodePage', 'gbk'); - try - tslFuncCount ++; - if code <> '' then - str := eval(&code); - except - println('run code={},err={}', code, ExceptObject.ErrInfo); - errArr[ length(errArr) ] := array('code':code, 'err':ExceptObject.ErrInfo); - str := ''; + 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'); diff --git a/funcext/TSOffice/word/_WordSetCurrentRange.tsf b/funcext/TSOffice/word/_WordSetCurrentRange.tsf new file mode 100644 index 0000000..164e117 --- /dev/null +++ b/funcext/TSOffice/word/_WordSetCurrentRange.tsf @@ -0,0 +1,4 @@ +Function _WordSetCurrentRange(range); +Begin + TOfficeApi().Set('CurrentPosition', range); +End; diff --git a/funcext/TSOffice/worksheet/xlsxWorkBook.tsf b/funcext/TSOffice/worksheet/xlsxWorkBook.tsf index 5e883df..5b9395f 100644 --- a/funcext/TSOffice/worksheet/xlsxWorkBook.tsf +++ b/funcext/TSOffice/worksheet/xlsxWorkBook.tsf @@ -1147,14 +1147,6 @@ Type xlsxWorkBook = Class Function ProtectSheet(sheet, protect); 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); work_node := sheet_obj.FirstChildElement('worksheet'); sheet_protection_node := work_node.FirstChildElement('sheetProtection');