mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-18 23:59:10 +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
|
begin
|
||||||
// First obtain the size information which duplicates GetTextExtentPoint
|
// First obtain the size information which duplicates GetTextExtentPoint
|
||||||
Result := GetTextExtentPoint(DC,Str,Count,Size);
|
Result := GetTextExtentPoint(DC,Str,Count,Size);
|
||||||
|
|
||||||
// Now calculate MaxCount and PartialWidths
|
// Now calculate MaxCount and PartialWidths
|
||||||
lPasStr := StrPas(Str);
|
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);
|
lPasStrLen := UTF8Length(lPasStr);
|
||||||
for i := 1 to lPasStrLen do
|
for i := 1 to lPasStrLen do
|
||||||
begin
|
begin
|
||||||
|
Loading…
Reference in New Issue
Block a user