fpspreadsheet: Move hyperlinkdemo to "others" folder. Make sure that "other" demos write their output in the project directory.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@7995 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2021-04-15 12:58:58 +00:00
parent 78348da3ef
commit 1cc0c3b66c
14 changed files with 81 additions and 42 deletions

View File

@ -14,6 +14,8 @@ var
sheet: TsWorksheet;
cell: PCell;
c: TsCryptoInfo;
dir: String;
begin
book := TsWorkbook.Create;
try
@ -35,10 +37,11 @@ begin
sheet.Protection := [spDeleteRows, spDeleteColumns, spInsertRows, spInsertColumns];
sheet.Protect(true);
book.WriteToFile('protected.xls', sfExcel8, true);
book.WriteToFile('protected.xlsx', sfOOXML, true);
dir := ExtractFilePath(ParamStr(0));
book.WriteToFile(dir + 'protected.xls', sfExcel8, true);
book.WriteToFile(dir + 'protected.xlsx', sfOOXML, true);
// Note ODS does not write the excel password correctly, yet. --> protection cannot be removed.
book.WriteToFile('protected.ods', sfOpenDocument, true);
book.WriteToFile(dir + 'protected.ods', sfOpenDocument, true);
finally
book.Free;