fpspreadsheet: Fix incorrect handling of CONTINUE record when reading biff8 if current string is UTF16

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@5209 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2016-09-25 11:07:35 +00:00
parent d8bf9f10b7
commit b034ec0017

View File

@ -666,6 +666,7 @@ var
AnsiStrValue: ansistring;
RunsCounter: WORD;
AsianPhoneticBytes: DWORD;
rtf_dummy: TsRichTextParams;
i: Integer;
j: Integer; //j: SizeUInt;
lLen: SizeInt;
@ -692,6 +693,13 @@ begin
SetLength(Result, PendingRecordSize div 2);
AStream.ReadBuffer(Result[1], PendingRecordSize);
Dec(PendingRecordSize, PendingRecordSize);
// We reached the end of the record and switch to the CONTINUE record
recType := WordLEToN(AStream.ReadWord);
recSize := WordLEToN(AStream.ReadWord);
if recType <> INT_EXCEL_ID_CONTINUE then
raise Exception.Create('[TsSpreadBIFF8Reader.ReadWideString] CONTINUE record expected, but not found.');
PendingRecordSize := recSize;
Result := Result + ReadWideString(AStream, ALength - Length(Result), rtf_dummy);
end else begin
SetLength(Result, ALength);
AStream.ReadBuffer(Result[1], ALength * SizeOf(WideChar));