View Issue Details

IDProjectCategoryView StatusLast Update
0035465LazarusLCLpublic2019-05-03 16:45
ReporterSerge AnvarovAssigned ToJuha Manninen 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version2.1 (SVN)Product Build 
Target VersionFixed in Version 
Summary0035465: The LCLBoundsToWin32Bounds function has two unused parameters: Width and Height
DescriptionThese parameters are not used in any widget function implementation.
That is, they can be safely removed by correcting all calls to this function. What is done in the attached patch.
TagsNo tags attached.
Fixed in Revisionr61112
LazTarget-
Widgetset
Attached Files
  • LCLBoundsToWin32Bounds.diff (7,447 bytes)
    Index: lcl/interfaces/customdrawn/customdrawn_winproc.pas
    ===================================================================
    --- lcl/interfaces/customdrawn/customdrawn_winproc.pas	(revision 61078)
    +++ lcl/interfaces/customdrawn/customdrawn_winproc.pas	(working copy)
    @@ -179,8 +179,7 @@
     
     function GetLCLClientBoundsOffset(Sender: TObject; var ORect: TRect): boolean;
     function GetLCLClientBoundsOffset(Handle: TWindowInfo; var Rect: TRect): boolean;
    -procedure LCLBoundsToWin32Bounds(Sender: TObject;
    -  var Left, Top, Width, Height: Integer);
    +procedure LCLBoundsToWin32Bounds(Sender: TObject; var Left, Top: Integer);
     procedure LCLFormSizeToWin32Size(Form: TCustomForm; var AWidth, AHeight: Integer);
     procedure GetWin32ControlPos(Window, Parent: HWND; var Left, Top: integer);
     
    @@ -1305,8 +1304,7 @@
       Result:=GetLCLClientBoundsOffset(OwnerObject, Rect);
     end;
     
    -procedure LCLBoundsToWin32Bounds(Sender: TObject;
    -  var Left, Top, Width, Height: Integer);
    +procedure LCLBoundsToWin32Bounds(Sender: TObject; var Left, Top: Integer);
     var
       ORect: TRect;
     Begin
    Index: lcl/interfaces/customdrawn/customdrawnwsforms_win.inc
    ===================================================================
    --- lcl/interfaces/customdrawn/customdrawnwsforms_win.inc	(revision 61078)
    +++ lcl/interfaces/customdrawn/customdrawnwsforms_win.inc	(working copy)
    @@ -143,7 +143,7 @@
       IntfTop := ATop;
       IntfWidth := AWidth;
       IntfHeight := AHeight;
    -  LCLBoundsToWin32Bounds(AWinControl, IntfLeft, IntfTop, IntfWidth, IntfHeight);
    +  LCLBoundsToWin32Bounds(AWinControl, IntfLeft, IntfTop);
       {$IFDEF VerboseCDForms}
       DebugLn('[TCDWSCustomForm.WSWinControl_SetBounds] A ', dbgsName(AWinControl),
         ' LCL=',Format('%d, %d, %d, %d', [ALeft,ATop,AWidth,AHeight]),
    @@ -176,7 +176,7 @@
     begin
       IntfLeft := ALeft; IntfTop := ATop;
       IntfWidth := AWidth; IntfHeight := AHeight;
    -  LCLBoundsToWin32Bounds(AWinControl, IntfLeft, IntfTop, IntfWidth, IntfHeight);
    +  LCLBoundsToWin32Bounds(AWinControl, IntfLeft, IntfTop);
       {$IFDEF VerboseSizeMsg}
       Debugln('TWinCEWSWinControl.ResizeWindow A ',AWinControl.Name,':',AWinControl.ClassName,
         ' LCL=',dbgs(ALeft),',',dbgs(ATop),',',dbgs(AWidth)+','+dbgs(AHeight),
    @@ -258,7 +258,7 @@
       Width := AParams.Width;
       Height := AParams.Height;
     
    -  LCLBoundsToWin32Bounds(AWinControl, Left, Top, Width, Height);
    +  LCLBoundsToWin32Bounds(AWinControl, Left, Top);
       //    if AWinControl is TCustomControl then
       //      if TCustomControl(AWinControl).BorderStyle = bsSingle then
       //        FlagsEx := FlagsEx or WS_EX_CLIENTEDGE;
    @@ -388,7 +388,7 @@
       Width := AParams.Width;
       Height := AParams.Height;
     
    -  LCLBoundsToWin32Bounds(AWinControl, Left, Top, Width, Height);
    +  LCLBoundsToWin32Bounds(AWinControl, Left, Top);
       //    if AWinControl is TCustomControl then
       //      if TCustomControl(AWinControl).BorderStyle = bsSingle then
       //        FlagsEx := FlagsEx or WS_EX_CLIENTEDGE;
    Index: lcl/interfaces/win32/win32proc.pp
    ===================================================================
    --- lcl/interfaces/win32/win32proc.pp	(revision 61078)
    +++ lcl/interfaces/win32/win32proc.pp	(working copy)
    @@ -84,7 +84,7 @@
     function LCLControlSizeNeedsUpdate(Sender: TWinControl; SendSizeMsgOnDiff: boolean): boolean;
     function GetLCLClientBoundsOffset(Sender: TObject; out ORect: TRect): boolean;
     function GetLCLClientBoundsOffset(Handle: HWnd; out Rect: TRect): boolean;
    -procedure LCLBoundsToWin32Bounds(Sender: TObject; var Left, Top, Width, Height: Integer);
    +procedure LCLBoundsToWin32Bounds(Sender: TObject; var Left, Top: Integer);
     procedure Win32PosToLCLPos(Sender: TObject; var Left, Top: SmallInt);
     procedure GetWin32ControlPos(Window, Parent: HWND; var Left, Top: integer);
     function GetWin32NativeDoubleBuffered(Sender: TWinControl): boolean;
    @@ -753,8 +753,7 @@
       Result := GetLCLClientBoundsOffset(OwnerObject, Rect);
     end;
     
    -procedure LCLBoundsToWin32Bounds(Sender: TObject;
    -  var Left, Top, Width, Height: Integer);
    +procedure LCLBoundsToWin32Bounds(Sender: TObject; var Left, Top: Integer);
     var
       ORect: TRect;
     begin
    Index: lcl/interfaces/win32/win32wscontrols.pp
    ===================================================================
    --- lcl/interfaces/win32/win32wscontrols.pp	(revision 61078)
    +++ lcl/interfaces/win32/win32wscontrols.pp	(working copy)
    @@ -161,7 +161,7 @@
         Width := CreateParams.Width;
         Height := CreateParams.Height;
     
    -    LCLBoundsToWin32Bounds(AWinControl, Left, Top, Width, Height);
    +    LCLBoundsToWin32Bounds(AWinControl, Left, Top);
         SetStdBiDiModeParams(AWinControl, Params);
     
         if not (csDesigning in AWinControl.ComponentState) and not AWinControl.IsEnabled then
    @@ -446,7 +446,7 @@
       IntfTop := ATop;
       IntfWidth := AWidth;
       IntfHeight := AHeight;
    -  LCLBoundsToWin32Bounds(AWinControl, IntfLeft, IntfTop, IntfWidth, IntfHeight);
    +  LCLBoundsToWin32Bounds(AWinControl, IntfLeft, IntfTop);
       {$IFDEF VerboseSizeMsg}
       DebugLn('TWin32WSWinControl.ResizeWindow A ', dbgsName(AWinControl),
         ' LCL=',Format('%d, %d, %d, %d', [ALeft,ATop,AWidth,AHeight]),
    Index: lcl/interfaces/win32/win32wsdialogs.pp
    ===================================================================
    --- lcl/interfaces/wince/wincelistsl.inc	(revision 61078)
    +++ lcl/interfaces/wince/wincelistsl.inc	(working copy)
    @@ -314,7 +314,7 @@
       Top := FSender.Top;
       Width := FSender.Width;
       Height := ComboHeight;
    -  LCLBoundsToWin32Bounds(FSender, Left, Top, Width, Height);
    +  LCLBoundsToWin32Bounds(FSender, Left, Top);
       MoveWindow(FSender.Handle, Left, Top, Width, Height, true);
       LCLControlSizeNeedsUpdate(FSender, true);
     end;
    Index: lcl/interfaces/wince/winceproc.pp
    ===================================================================
    --- lcl/interfaces/wince/winceproc.pp	(revision 61078)
    +++ lcl/interfaces/wince/winceproc.pp	(working copy)
    @@ -75,8 +75,7 @@
     
     function GetLCLClientBoundsOffset(Sender: TObject; var ORect: TRect): boolean;
     function GetLCLClientBoundsOffset(Handle: HWnd; var Rect: TRect): boolean;
    -procedure LCLBoundsToWin32Bounds(Sender: TObject;
    -  var Left, Top, Width, Height: Integer);
    +procedure LCLBoundsToWin32Bounds(Sender: TObject; var Left, Top: Integer);
     procedure LCLFormSizeToWin32Size(Form: TCustomForm; var AWidth, AHeight: Integer);
     procedure GetWin32ControlPos(Window, Parent: HWND; var Left, Top: integer);
     
    Index: lcl/interfaces/wince/wincewscontrols.pp
    ===================================================================
    --- lcl/interfaces/wince/wincewscontrols.pp	(revision 61078)
    +++ lcl/interfaces/wince/wincewscontrols.pp	(working copy)
    @@ -164,7 +164,7 @@
         Width := CreateParams.Width;
         Height := CreateParams.Height;
     
    -    LCLBoundsToWin32Bounds(AWinControl, Left, Top, Width, Height);
    +    LCLBoundsToWin32Bounds(AWinControl, Left, Top);
         if AWinControl is TCustomControl then
           if TCustomControl(AWinControl).BorderStyle = bsSingle then
             FlagsEx := FlagsEx or WS_EX_CLIENTEDGE;
    @@ -392,7 +392,7 @@
     begin
       IntfLeft := ALeft; IntfTop := ATop;
       IntfWidth := AWidth; IntfHeight := AHeight;
    -  LCLBoundsToWin32Bounds(AWinControl, IntfLeft, IntfTop, IntfWidth, IntfHeight);
    +  LCLBoundsToWin32Bounds(AWinControl, IntfLeft, IntfTop);
       {$IFDEF VerboseSizeMsg}
       Debugln('TWinCEWSWinControl.ResizeWindow A ',AWinControl.Name,':',AWinControl.ClassName,
         ' LCL=',dbgs(ALeft),',',dbgs(ATop),',',dbgs(AWidth)+','+dbgs(AHeight),
    

Activities

Serge Anvarov

2019-04-29 08:36

reporter  

LCLBoundsToWin32Bounds.diff (7,447 bytes)
Index: lcl/interfaces/customdrawn/customdrawn_winproc.pas
===================================================================
--- lcl/interfaces/customdrawn/customdrawn_winproc.pas	(revision 61078)
+++ lcl/interfaces/customdrawn/customdrawn_winproc.pas	(working copy)
@@ -179,8 +179,7 @@
 
 function GetLCLClientBoundsOffset(Sender: TObject; var ORect: TRect): boolean;
 function GetLCLClientBoundsOffset(Handle: TWindowInfo; var Rect: TRect): boolean;
-procedure LCLBoundsToWin32Bounds(Sender: TObject;
-  var Left, Top, Width, Height: Integer);
+procedure LCLBoundsToWin32Bounds(Sender: TObject; var Left, Top: Integer);
 procedure LCLFormSizeToWin32Size(Form: TCustomForm; var AWidth, AHeight: Integer);
 procedure GetWin32ControlPos(Window, Parent: HWND; var Left, Top: integer);
 
@@ -1305,8 +1304,7 @@
   Result:=GetLCLClientBoundsOffset(OwnerObject, Rect);
 end;
 
-procedure LCLBoundsToWin32Bounds(Sender: TObject;
-  var Left, Top, Width, Height: Integer);
+procedure LCLBoundsToWin32Bounds(Sender: TObject; var Left, Top: Integer);
 var
   ORect: TRect;
 Begin
Index: lcl/interfaces/customdrawn/customdrawnwsforms_win.inc
===================================================================
--- lcl/interfaces/customdrawn/customdrawnwsforms_win.inc	(revision 61078)
+++ lcl/interfaces/customdrawn/customdrawnwsforms_win.inc	(working copy)
@@ -143,7 +143,7 @@
   IntfTop := ATop;
   IntfWidth := AWidth;
   IntfHeight := AHeight;
-  LCLBoundsToWin32Bounds(AWinControl, IntfLeft, IntfTop, IntfWidth, IntfHeight);
+  LCLBoundsToWin32Bounds(AWinControl, IntfLeft, IntfTop);
   {$IFDEF VerboseCDForms}
   DebugLn('[TCDWSCustomForm.WSWinControl_SetBounds] A ', dbgsName(AWinControl),
     ' LCL=',Format('%d, %d, %d, %d', [ALeft,ATop,AWidth,AHeight]),
@@ -176,7 +176,7 @@
 begin
   IntfLeft := ALeft; IntfTop := ATop;
   IntfWidth := AWidth; IntfHeight := AHeight;
-  LCLBoundsToWin32Bounds(AWinControl, IntfLeft, IntfTop, IntfWidth, IntfHeight);
+  LCLBoundsToWin32Bounds(AWinControl, IntfLeft, IntfTop);
   {$IFDEF VerboseSizeMsg}
   Debugln('TWinCEWSWinControl.ResizeWindow A ',AWinControl.Name,':',AWinControl.ClassName,
     ' LCL=',dbgs(ALeft),',',dbgs(ATop),',',dbgs(AWidth)+','+dbgs(AHeight),
@@ -258,7 +258,7 @@
   Width := AParams.Width;
   Height := AParams.Height;
 
-  LCLBoundsToWin32Bounds(AWinControl, Left, Top, Width, Height);
+  LCLBoundsToWin32Bounds(AWinControl, Left, Top);
   //    if AWinControl is TCustomControl then
   //      if TCustomControl(AWinControl).BorderStyle = bsSingle then
   //        FlagsEx := FlagsEx or WS_EX_CLIENTEDGE;
@@ -388,7 +388,7 @@
   Width := AParams.Width;
   Height := AParams.Height;
 
-  LCLBoundsToWin32Bounds(AWinControl, Left, Top, Width, Height);
+  LCLBoundsToWin32Bounds(AWinControl, Left, Top);
   //    if AWinControl is TCustomControl then
   //      if TCustomControl(AWinControl).BorderStyle = bsSingle then
   //        FlagsEx := FlagsEx or WS_EX_CLIENTEDGE;
Index: lcl/interfaces/win32/win32proc.pp
===================================================================
--- lcl/interfaces/win32/win32proc.pp	(revision 61078)
+++ lcl/interfaces/win32/win32proc.pp	(working copy)
@@ -84,7 +84,7 @@
 function LCLControlSizeNeedsUpdate(Sender: TWinControl; SendSizeMsgOnDiff: boolean): boolean;
 function GetLCLClientBoundsOffset(Sender: TObject; out ORect: TRect): boolean;
 function GetLCLClientBoundsOffset(Handle: HWnd; out Rect: TRect): boolean;
-procedure LCLBoundsToWin32Bounds(Sender: TObject; var Left, Top, Width, Height: Integer);
+procedure LCLBoundsToWin32Bounds(Sender: TObject; var Left, Top: Integer);
 procedure Win32PosToLCLPos(Sender: TObject; var Left, Top: SmallInt);
 procedure GetWin32ControlPos(Window, Parent: HWND; var Left, Top: integer);
 function GetWin32NativeDoubleBuffered(Sender: TWinControl): boolean;
@@ -753,8 +753,7 @@
   Result := GetLCLClientBoundsOffset(OwnerObject, Rect);
 end;
 
-procedure LCLBoundsToWin32Bounds(Sender: TObject;
-  var Left, Top, Width, Height: Integer);
+procedure LCLBoundsToWin32Bounds(Sender: TObject; var Left, Top: Integer);
 var
   ORect: TRect;
 begin
Index: lcl/interfaces/win32/win32wscontrols.pp
===================================================================
--- lcl/interfaces/win32/win32wscontrols.pp	(revision 61078)
+++ lcl/interfaces/win32/win32wscontrols.pp	(working copy)
@@ -161,7 +161,7 @@
     Width := CreateParams.Width;
     Height := CreateParams.Height;
 
-    LCLBoundsToWin32Bounds(AWinControl, Left, Top, Width, Height);
+    LCLBoundsToWin32Bounds(AWinControl, Left, Top);
     SetStdBiDiModeParams(AWinControl, Params);
 
     if not (csDesigning in AWinControl.ComponentState) and not AWinControl.IsEnabled then
@@ -446,7 +446,7 @@
   IntfTop := ATop;
   IntfWidth := AWidth;
   IntfHeight := AHeight;
-  LCLBoundsToWin32Bounds(AWinControl, IntfLeft, IntfTop, IntfWidth, IntfHeight);
+  LCLBoundsToWin32Bounds(AWinControl, IntfLeft, IntfTop);
   {$IFDEF VerboseSizeMsg}
   DebugLn('TWin32WSWinControl.ResizeWindow A ', dbgsName(AWinControl),
     ' LCL=',Format('%d, %d, %d, %d', [ALeft,ATop,AWidth,AHeight]),
Index: lcl/interfaces/win32/win32wsdialogs.pp
===================================================================
--- lcl/interfaces/wince/wincelistsl.inc	(revision 61078)
+++ lcl/interfaces/wince/wincelistsl.inc	(working copy)
@@ -314,7 +314,7 @@
   Top := FSender.Top;
   Width := FSender.Width;
   Height := ComboHeight;
-  LCLBoundsToWin32Bounds(FSender, Left, Top, Width, Height);
+  LCLBoundsToWin32Bounds(FSender, Left, Top);
   MoveWindow(FSender.Handle, Left, Top, Width, Height, true);
   LCLControlSizeNeedsUpdate(FSender, true);
 end;
Index: lcl/interfaces/wince/winceproc.pp
===================================================================
--- lcl/interfaces/wince/winceproc.pp	(revision 61078)
+++ lcl/interfaces/wince/winceproc.pp	(working copy)
@@ -75,8 +75,7 @@
 
 function GetLCLClientBoundsOffset(Sender: TObject; var ORect: TRect): boolean;
 function GetLCLClientBoundsOffset(Handle: HWnd; var Rect: TRect): boolean;
-procedure LCLBoundsToWin32Bounds(Sender: TObject;
-  var Left, Top, Width, Height: Integer);
+procedure LCLBoundsToWin32Bounds(Sender: TObject; var Left, Top: Integer);
 procedure LCLFormSizeToWin32Size(Form: TCustomForm; var AWidth, AHeight: Integer);
 procedure GetWin32ControlPos(Window, Parent: HWND; var Left, Top: integer);
 
Index: lcl/interfaces/wince/wincewscontrols.pp
===================================================================
--- lcl/interfaces/wince/wincewscontrols.pp	(revision 61078)
+++ lcl/interfaces/wince/wincewscontrols.pp	(working copy)
@@ -164,7 +164,7 @@
     Width := CreateParams.Width;
     Height := CreateParams.Height;
 
-    LCLBoundsToWin32Bounds(AWinControl, Left, Top, Width, Height);
+    LCLBoundsToWin32Bounds(AWinControl, Left, Top);
     if AWinControl is TCustomControl then
       if TCustomControl(AWinControl).BorderStyle = bsSingle then
         FlagsEx := FlagsEx or WS_EX_CLIENTEDGE;
@@ -392,7 +392,7 @@
 begin
   IntfLeft := ALeft; IntfTop := ATop;
   IntfWidth := AWidth; IntfHeight := AHeight;
-  LCLBoundsToWin32Bounds(AWinControl, IntfLeft, IntfTop, IntfWidth, IntfHeight);
+  LCLBoundsToWin32Bounds(AWinControl, IntfLeft, IntfTop);
   {$IFDEF VerboseSizeMsg}
   Debugln('TWinCEWSWinControl.ResizeWindow A ',AWinControl.Name,':',AWinControl.ClassName,
     ' LCL=',dbgs(ALeft),',',dbgs(ATop),',',dbgs(AWidth)+','+dbgs(AHeight),

Juha Manninen

2019-05-03 16:45

developer   ~0115973

Applied, thanks.

Issue History

Date Modified Username Field Change
2019-04-29 08:36 Serge Anvarov New Issue
2019-04-29 08:36 Serge Anvarov File Added: LCLBoundsToWin32Bounds.diff
2019-05-03 16:42 Juha Manninen Assigned To => Juha Manninen
2019-05-03 16:42 Juha Manninen Status new => assigned
2019-05-03 16:45 Juha Manninen Status assigned => resolved
2019-05-03 16:45 Juha Manninen Resolution open => fixed
2019-05-03 16:45 Juha Manninen Fixed in Revision => r61112
2019-05-03 16:45 Juha Manninen LazTarget => -
2019-05-03 16:45 Juha Manninen Note Added: 0115973