mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-06 19:00:34 +02:00
Gtk2,Qt: fixed returning value of GetTextExtentPoint() when string is empty.
git-svn-id: trunk@36108 -
This commit is contained in:
parent
ff6253e4ac
commit
32c73d9d34
@ -5947,7 +5947,7 @@ var
|
||||
begin
|
||||
Result := IsValidDC(DC);
|
||||
if not Result then Exit;
|
||||
if Count <= 0 then
|
||||
if (Count <= 0) or (StrPas(Str) = '') then
|
||||
begin
|
||||
FillChar(Size, SizeOf(Size), 0);
|
||||
Exit;
|
||||
|
@ -4076,10 +4076,15 @@ begin
|
||||
WriteLn('[WinAPI GetTextExtentPoint]');
|
||||
{$endif}
|
||||
|
||||
Result := False;
|
||||
Result := IsValidDC(DC);
|
||||
|
||||
if not IsValidDC(DC) then Exit;
|
||||
if not Result then
|
||||
exit;
|
||||
|
||||
Size.cx := 0;
|
||||
Size.cy := 0;
|
||||
if (StrPas(Str) = '') or (Count <= 0) then
|
||||
exit;
|
||||
WideStr := GetUtf8String(Str);
|
||||
Size.cx := QtDC.Metrics.width(@WideStr, Count);
|
||||
Size.cy := QtDC.Metrics.height;
|
||||
|
Loading…
Reference in New Issue
Block a user