mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-09 18:08:35 +02:00
LCL: fixed wrong result of GetTextExtentExPoint() when string param is nil or empty an string.
git-svn-id: trunk@36138 -
This commit is contained in:
parent
065bc9485c
commit
55c2b15076
@ -1108,9 +1108,15 @@ var
|
||||
begin
|
||||
// First obtain the size information which duplicates GetTextExtentPoint
|
||||
Result := GetTextExtentPoint(DC,Str,Count,Size);
|
||||
|
||||
// Now calculate MaxCount and PartialWidths
|
||||
lPasStr := StrPas(Str);
|
||||
if (Str = nil) or (Count <= 0) or (lPasStr = '') then
|
||||
begin
|
||||
Result := False;
|
||||
if MaxCount <> nil then
|
||||
MaxCount^ := 0;
|
||||
exit;
|
||||
end;
|
||||
lPasStrLen := UTF8Length(lPasStr);
|
||||
for i := 1 to lPasStrLen do
|
||||
begin
|
||||
|
Loading…
Reference in New Issue
Block a user