FpSpreadsheet: Fix range overflow when a cell range is copied in spready to the clipboard.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@9741 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz 2025-05-12 15:45:56 +00:00
parent fc71c0cf31
commit 7e0d30209a
2 changed files with 12 additions and 0 deletions

View File

@ -4539,6 +4539,12 @@ var
len: Integer;
wideStr: WideString;
begin
if AString = '' then
begin
Result := 0;
exit;
end;
// string constant is stored as widestring in BIFF8
wideStr := UTF8Decode(AString);
len := Length(wideStr);

View File

@ -5724,6 +5724,12 @@ var
len: Byte;
s: ansistring;
begin
if AString = '' then
begin
Result := 0;
exit;
end;
s := ConvertEncoding(AString, encodingUTF8, FCodePage);
len := Length(s);
AStream.WriteByte(len);