mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-08 05:58:15 +02:00
LCL: Prevent an occational range error in ShellListView. Remove useless checks.
This commit is contained in:
parent
e4d6aa9125
commit
82b9902b12
@ -188,10 +188,10 @@ var
|
||||
W: TWidth;
|
||||
begin
|
||||
W := AValue;
|
||||
if (MinWidth > 0) and (W < MinWidth) then
|
||||
if W < MinWidth then
|
||||
W := MinWidth
|
||||
else
|
||||
if (MaxWidth > 0) and (W > MaxWidth) then
|
||||
if W > MaxWidth then
|
||||
W := MaxWidth;
|
||||
if Width = W then Exit; // compare with Width instead of FWidth - FWidth is not updated from the WS automatically
|
||||
FWidth := W;
|
||||
|
@ -22,7 +22,7 @@ unit ShellCtrls;
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, Laz_AVL_Tree,
|
||||
Classes, SysUtils, Math, Laz_AVL_Tree,
|
||||
// LCL
|
||||
Forms, Graphics, ComCtrls, LCLProc, LCLType, LCLStrConsts, Types,
|
||||
// LazUtils
|
||||
@ -1601,7 +1601,7 @@ begin
|
||||
Column[0].Width := (70 * iWidth) div 100;
|
||||
Column[1].Width := (15 * iWidth) div 100;
|
||||
end;
|
||||
Column[2].Width := iWidth - Column[0].Width - Column[1].Width;
|
||||
Column[2].Width := Max(0, iWidth - Column[0].Width - Column[1].Width);
|
||||
finally
|
||||
EndUpdate;
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user