lcl: less with-blocks for FPC 3.1.1

git-svn-id: trunk@50290 -
This commit is contained in:
mattias 2015-11-11 13:17:39 +00:00
parent 7af80b6b19
commit 1a4afb9d1d
2 changed files with 14 additions and 14 deletions

View File

@ -360,25 +360,25 @@ begin
Result:=-1;
end;
function RectFromGdkRect(AGdkRect: TGdkRectangle): TRect;
function RectFromGdkRect(const AGdkRect: TGdkRectangle): TRect;
begin
with Result, AGdkRect do
with Result do
begin
Left := x;
Top := y;
Right := Width + x;
Bottom := Height + y;
Left := AGdkRect.x;
Top := AGdkRect.y;
Right := AGdkRect.Width + AGdkRect.x;
Bottom := AGdkRect.Height + AGdkRect.y;
end;
end;
function GdkRectFromRect(R: TRect): TGdkRectangle;
function GdkRectFromRect(const R: TRect): TGdkRectangle;
begin
with Result, R do
with Result do
begin
x := Left;
y := Top;
width := Right-Left;
height := Bottom-Top;
x := R.Left;
y := R.Top;
width := R.Right-R.Left;
height := R.Bottom-R.Top;
end;
end;

View File

@ -277,8 +277,8 @@ var
//==============================================================================
// functions
function RectFromGdkRect(AGdkRect: TGdkRectangle): TRect;
function GdkRectFromRect(R: TRect): TGdkRectangle;
function RectFromGdkRect(const AGdkRect: TGdkRectangle): TRect;
function GdkRectFromRect(const R: TRect): TGdkRectangle;
function AlignToGtkAlign(Align: TAlignment): gfloat;
{$ifdef gtk2}
function GtkScrollTypeToScrollCode(ScrollType: TGtkScrollType): LongWord;