mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-31 08:00:24 +02:00
LCL: Do not raise a "division by zero" when accessing non-existing notebook tabs. TList already checks range. Issue #35588.
git-svn-id: trunk@61289 -
This commit is contained in:
parent
95b9f913d4
commit
43b19b2c60
@ -61,43 +61,23 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
TNBPages Get
|
||||
------------------------------------------------------------------------------}
|
||||
function TNBPages.Get(Index: Integer): String;
|
||||
begin
|
||||
//DebugLn('TNBPages.Get Index=',Index);
|
||||
if (Index<0) or (Index>=FPageList.Count) then
|
||||
RaiseGDBException('TNBPages.Get Index out of bounds');
|
||||
Result := TCustomPage(FPageList[Index]).Caption;
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
TNBPages GetCount
|
||||
------------------------------------------------------------------------------}
|
||||
function TNBPages.GetCount: Integer;
|
||||
begin
|
||||
Result := FPageList.Count;
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
TNBPages GetObject
|
||||
------------------------------------------------------------------------------}
|
||||
function TNBPages.GetObject(Index: Integer): TObject;
|
||||
begin
|
||||
if (Index<0) or (Index>=FPageList.Count) then
|
||||
RaiseGDBException('TNBPages.GetObject Index out of bounds');
|
||||
Result := TObject(FPageList[Index]);
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
TNBPages Put
|
||||
------------------------------------------------------------------------------}
|
||||
procedure TNBPages.Put(Index: Integer; const S: String);
|
||||
begin
|
||||
if (Index<0) or (Index>=FPageList.Count) then
|
||||
RaiseGDBException('TNBPages.Put Index out of bounds');
|
||||
//debugln(['TNBPages.Put ',DbgSName(FNotebook),' ',Index,' S="',S,'"']);
|
||||
TCustomPage(FPageList[Index]).Caption := S;
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user