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:
@@ -361,6 +361,8 @@ bool wxSizer::Remove( wxSizer *sizer )
|
|||||||
|
|
||||||
bool wxSizer::Remove( int pos )
|
bool wxSizer::Remove( int pos )
|
||||||
{
|
{
|
||||||
|
if ((size_t)pos >= m_children.GetCount())
|
||||||
|
return FALSE;
|
||||||
wxNode *node = m_children.Nth( pos );
|
wxNode *node = m_children.Nth( pos );
|
||||||
if (!node) return FALSE;
|
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 wxGridSizer::CalcRowsCols(int& nrows, int& ncols) const
|
||||||
{
|
{
|
||||||
int nitems = m_children.GetCount();
|
int nitems = m_children.GetCount();
|
||||||
if ( nitems)
|
if ( nitems)
|
||||||
{
|
{
|
||||||
if ( m_cols )
|
if ( m_cols )
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user