You've already forked lazarus-ccr
fpspreadsheet: minor refactoring of crypto example.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8199 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -44,16 +44,15 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
if not FileExists(InputFileName) then begin
|
||||
WriteLn('Input file ', InputFileName, ' does not exist. Please run opendocwrite first.');
|
||||
Halt;
|
||||
end;
|
||||
if FileExists(InputFileName) then
|
||||
begin
|
||||
WriteLn('Opening input file ', InputFilename);
|
||||
|
||||
// Create the spreadsheet
|
||||
MyWorkbook := TsWorkbook.Create;
|
||||
|
||||
MyWorkbook.Options := MyWorkbook.Options + [boReadFormulas];
|
||||
try
|
||||
try
|
||||
MyWorkbook.ReadFromFile(InputFilename, sfidOOXML_crypto, password);
|
||||
|
||||
MyWorksheet := MyWorkbook.GetFirstWorksheet;
|
||||
@ -69,9 +68,17 @@ begin
|
||||
' Col: ', cell^.Col,
|
||||
' Value: ', UTF8ToConsole(MyWorkSheet.ReadAsText(cell^.Row, cell^.Col))
|
||||
);
|
||||
except
|
||||
WriteLn('Error opening file ', InputFileName);
|
||||
end;
|
||||
|
||||
finally
|
||||
// Finalization
|
||||
MyWorkbook.Free;
|
||||
end;
|
||||
end
|
||||
else
|
||||
WriteLn('Input file ', InputFileName, ' does not exist.');
|
||||
|
||||
if ParamCount = 0 then
|
||||
begin
|
||||
|
Reference in New Issue
Block a user