fpspreadsheet: Fix crash in the biff8 reader's FreeSharedStringTable when no SST is used.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@6912 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2019-05-13 15:43:06 +00:00
parent 505f61a073
commit d650914a3f

View File

@ -816,15 +816,17 @@ end;
{@@ ---------------------------------------------------------------------------- {@@ ----------------------------------------------------------------------------
Frees the shared string table. Also: destroys the rich-text memory streams Frees the shared string table. Also: destroys the rich-text memory streams
which can be assigned to string table items. which may be assigned to string table items.
-------------------------------------------------------------------------------} -------------------------------------------------------------------------------}
procedure TsSpreadBIFF8Reader.FreeSharedStringTable; procedure TsSpreadBIFF8Reader.FreeSharedStringTable;
var var
j: Integer; j: Integer;
begin begin
for j := 0 to FSharedStringTable.Count-1 do if FSharedStringTable <> nil then begin
TObject(FSharedStringTable.Objects[j]).Free; for j := 0 to FSharedStringTable.Count-1 do
FreeAndNil(FSharedStringTable); TObject(FSharedStringTable.Objects[j]).Free;
FreeAndNil(FSharedStringTable);
end;
end; end;
{@@ ---------------------------------------------------------------------------- {@@ ----------------------------------------------------------------------------