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:
zeljko 2012-03-17 20:46:08 +00:00
parent 065bc9485c
commit 55c2b15076

View File

@ -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