Fixes read of SST table when empty strings are present.

Renamed variable "Continue" to "ContinueIndicator" to avoid conflict with Pascal's Continue.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2110 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
Joshy
2011-11-02 22:33:19 +00:00
parent c2f6ef2e8e
commit 2c03552fdf

View File

@ -1752,7 +1752,7 @@ var
Items: DWORD;
StringLength: WORD;
LString: String;
Continue: WORD;
ContinueIndicator: WORD;
begin
//Reads the shared string table, only compatible with BIFF8
if not Assigned(FSharedStringTable) then begin
@ -1775,16 +1775,22 @@ begin
if StringLength>0 then begin
//Read a stream of zero length reads all the stream.
LString:=LString+ReadString(AStream,StringLength);
end else begin
//String of 0 chars in length, so just read it empty, reading only the mandatory flags
AStream.ReadByte; //And discard it.
Dec(PendingRecordSize);
//LString:=LString+'';
end;
if (PendingRecordSize=0) and (Items>1) then begin
//A continue will happend, read the continue
//A Continue will happend, read the
//tag and continue linking...
Continue:=WordLEtoN(AStream.ReadWord);
if Continue<>INT_EXCEL_ID_CONTINUE then begin
ContinueIndicator:=WordLEtoN(AStream.ReadWord);
if ContinueIndicator<>INT_EXCEL_ID_CONTINUE then begin
Raise Exception.Create('Expected CONTINUE not found.');
end;
PendingRecordSize:=WordLEtoN(AStream.ReadWord);
Dec(StringLength,Length(UTF8Decode(LString))); //Dec the used chars
if StringLength=0 then break;
end else begin
break;
end;