mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-18 00:29:34 +02:00
Cocoa: Fix #40939 arithmetic overflow in TabControl
This commit is contained in:
parent
cf53186c8e
commit
3670e936f8
lcl/interfaces/cocoa
@ -297,7 +297,7 @@ begin
|
||||
|
||||
lw := 0;
|
||||
SetLength(lwid, arr.count);
|
||||
for i := 0 to arr.count - 1 do
|
||||
for i := 0 to Integer(arr.count) - 1 do
|
||||
begin
|
||||
vi := NSTabViewItem( arr.objectAtIndex(i) );
|
||||
sz := vi.sizeOfLabel(false);
|
||||
@ -948,10 +948,10 @@ var
|
||||
currentIndex: Integer;
|
||||
begin
|
||||
currentIndex := _tabControl.currentIndex;
|
||||
if currentIndex = _tabControl.fulltabs.count - 1 then
|
||||
if currentIndex = Integer(_tabControl.fulltabs.count) - 1 then
|
||||
Exit;
|
||||
if shouldSpeedUp() then
|
||||
currentIndex := _tabControl.fulltabs.count - 1
|
||||
currentIndex := Integer(_tabControl.fulltabs.count) - 1
|
||||
else
|
||||
inc(currentIndex);
|
||||
_tabControl.extselectTabViewItemAtIndex(currentIndex);
|
||||
|
@ -860,7 +860,7 @@ begin
|
||||
ofs := (tr.Right - tr.Left - mw) / length(w);
|
||||
|
||||
x := tr.Left;
|
||||
for i := 0 to idx-1 do
|
||||
for i := 0 to Integer(idx)-1 do
|
||||
x := x+ofs+w[i];
|
||||
|
||||
Result.Left := Round(x);
|
||||
@ -882,7 +882,7 @@ begin
|
||||
ofs := (tr.Bottom - tr.Top - mw) / length(w);
|
||||
|
||||
x := tr.Top;
|
||||
for i := 0 to idx-1 do
|
||||
for i := 0 to Integer(idx)-1 do
|
||||
x := x+ofs+w[i];
|
||||
|
||||
Result.Left := tr.Left;
|
||||
|
Loading…
Reference in New Issue
Block a user