diff --git a/lcl/interfaces/gtk2/gtk2def.pp b/lcl/interfaces/gtk2/gtk2def.pp index 0c9557a71a..4fdc526e6a 100644 --- a/lcl/interfaces/gtk2/gtk2def.pp +++ b/lcl/interfaces/gtk2/gtk2def.pp @@ -44,7 +44,7 @@ type procedure DrawTextWithColors(AText: PChar; ALength: LongInt; X, Y: Integer; FGColor, BGColor: PGdkColor); end; - procedure SetLayoutText(ALayout: PPangoLayout; AText: PChar; ALength: LongInt); + procedure SetLayoutText(ALayout: PPangoLayout; AText: PChar; ALength: PtrInt); implementation {$i gtk2devicecontext.inc} diff --git a/lcl/interfaces/gtk2/gtk2devicecontext.inc b/lcl/interfaces/gtk2/gtk2devicecontext.inc index 0f5f67ca6f..94fa0d3586 100644 --- a/lcl/interfaces/gtk2/gtk2devicecontext.inc +++ b/lcl/interfaces/gtk2/gtk2devicecontext.inc @@ -24,12 +24,12 @@ // {$DEFINE ASSERT_IS_ON} {$ENDIF} -procedure SetLayoutText(ALayout: PPangoLayout; AText: PChar; ALength: LongInt); +procedure SetLayoutText(ALayout: PPangoLayout; AText: PChar; ALength: PtrInt); var OldStr: PChar; begin OldStr := pango_layout_get_text(ALayout); - if (strcomp(AText, OldStr) <> 0) then + if (strlcomp(AText, OldStr, ALength) <> 0) then pango_layout_set_text(ALayout, AText, ALength); end;