mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-12-05 15:57:18 +01:00
gtk2 intf: fixed GetTextExtentIgnoringAmpersands checking for line end
git-svn-id: trunk@11724 -
This commit is contained in:
parent
8fdda10624
commit
e81f58a39e
@ -9259,10 +9259,12 @@ end;
|
|||||||
That means, ampersands are not counted.
|
That means, ampersands are not counted.
|
||||||
-------------------------------------------------------------------------------}
|
-------------------------------------------------------------------------------}
|
||||||
{$Ifdef GTK2}
|
{$Ifdef GTK2}
|
||||||
Procedure GetTextExtentIgnoringAmpersands(FontDesc : PPangoFontDescription; Str : PChar;
|
Procedure GetTextExtentIgnoringAmpersands(FontDesc : PPangoFontDescription;
|
||||||
|
Str : PChar;
|
||||||
LineLength : Longint; lbearing, rbearing, width, ascent, descent : Pgint);
|
LineLength : Longint; lbearing, rbearing, width, ascent, descent : Pgint);
|
||||||
{$Else}
|
{$Else}
|
||||||
Procedure GetTextExtentIgnoringAmpersands(FontDesc : PGDKFont; Str : PChar;
|
Procedure GetTextExtentIgnoringAmpersands(FontDesc : PGDKFont;
|
||||||
|
Str : PChar;
|
||||||
LineLength : Longint; lbearing, rbearing, width, ascent, descent : Pgint);
|
LineLength : Longint; lbearing, rbearing, width, ascent, descent : Pgint);
|
||||||
{$EndIf}
|
{$EndIf}
|
||||||
var
|
var
|
||||||
@ -9273,8 +9275,8 @@ begin
|
|||||||
// first check if Str contains an ampersand:
|
// first check if Str contains an ampersand:
|
||||||
if (Str<>nil) then begin
|
if (Str<>nil) then begin
|
||||||
i:=0;
|
i:=0;
|
||||||
while (not (Str[i] in [#0,'&'])) do inc(i);
|
while (Str[i]<>'&') and (i<LineLength) do inc(i);
|
||||||
if Str[i]='&' then begin
|
if i<LineLength then begin
|
||||||
NewStr := RemoveAmpersands(Str, LineLength);
|
NewStr := RemoveAmpersands(Str, LineLength);
|
||||||
LineLength:=StrLen(NewStr);
|
LineLength:=StrLen(NewStr);
|
||||||
end;
|
end;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user