Avoid assert when the position to be removed is beyond the end of the

list and just return FALSE as documented


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@17444 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2002-10-03 19:50:39 +00:00
parent 3512d53ddd
commit 7d1ab59731

View File

@@ -361,6 +361,8 @@ bool wxSizer::Remove( wxSizer *sizer )
bool wxSizer::Remove( int pos )
{
if ((size_t)pos >= m_children.GetCount())
return FALSE;
wxNode *node = m_children.Nth( pos );
if (!node) return FALSE;
@@ -659,7 +661,7 @@ wxGridSizer::wxGridSizer( int cols, int vgap, int hgap )
int wxGridSizer::CalcRowsCols(int& nrows, int& ncols) const
{
int nitems = m_children.GetCount();
if ( nitems)
if ( nitems)
{
if ( m_cols )
{