You've already forked lazarus-ccr
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:
@ -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));
|
||||
|
Reference in New Issue
Block a user