mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-24 11:19:29 +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;
|
W: TWidth;
|
||||||
begin
|
begin
|
||||||
W := AValue;
|
W := AValue;
|
||||||
if (MinWidth > 0) and (W < MinWidth) then
|
if W < MinWidth then
|
||||||
W := MinWidth
|
W := MinWidth
|
||||||
else
|
else
|
||||||
if (MaxWidth > 0) and (W > MaxWidth) then
|
if W > MaxWidth then
|
||||||
W := MaxWidth;
|
W := MaxWidth;
|
||||||
if Width = W then Exit; // compare with Width instead of FWidth - FWidth is not updated from the WS automatically
|
if Width = W then Exit; // compare with Width instead of FWidth - FWidth is not updated from the WS automatically
|
||||||
FWidth := W;
|
FWidth := W;
|
||||||
|
@ -22,7 +22,7 @@ unit ShellCtrls;
|
|||||||
interface
|
interface
|
||||||
|
|
||||||
uses
|
uses
|
||||||
Classes, SysUtils, Laz_AVL_Tree,
|
Classes, SysUtils, Math, Laz_AVL_Tree,
|
||||||
// LCL
|
// LCL
|
||||||
Forms, Graphics, ComCtrls, LCLProc, LCLType, LCLStrConsts, Types,
|
Forms, Graphics, ComCtrls, LCLProc, LCLType, LCLStrConsts, Types,
|
||||||
// LazUtils
|
// LazUtils
|
||||||
@ -1601,7 +1601,7 @@ begin
|
|||||||
Column[0].Width := (70 * iWidth) div 100;
|
Column[0].Width := (70 * iWidth) div 100;
|
||||||
Column[1].Width := (15 * iWidth) div 100;
|
Column[1].Width := (15 * iWidth) div 100;
|
||||||
end;
|
end;
|
||||||
Column[2].Width := iWidth - Column[0].Width - Column[1].Width;
|
Column[2].Width := Max(0, iWidth - Column[0].Width - Column[1].Width);
|
||||||
finally
|
finally
|
||||||
EndUpdate;
|
EndUpdate;
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user