Add some asserts to ensure cols and rows are >= 0 to avoid crashes
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65987 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1319,6 +1319,7 @@ wxGridSizer::wxGridSizer( int cols, int vgap, int hgap )
|
|||||||
m_vgap( vgap ),
|
m_vgap( vgap ),
|
||||||
m_hgap( hgap )
|
m_hgap( hgap )
|
||||||
{
|
{
|
||||||
|
wxASSERT(cols >= 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
wxGridSizer::wxGridSizer( int cols, const wxSize& gap )
|
wxGridSizer::wxGridSizer( int cols, const wxSize& gap )
|
||||||
@@ -1327,6 +1328,7 @@ wxGridSizer::wxGridSizer( int cols, const wxSize& gap )
|
|||||||
m_vgap( gap.GetHeight() ),
|
m_vgap( gap.GetHeight() ),
|
||||||
m_hgap( gap.GetWidth() )
|
m_hgap( gap.GetWidth() )
|
||||||
{
|
{
|
||||||
|
wxASSERT(cols >= 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
wxGridSizer::wxGridSizer( int rows, int cols, int vgap, int hgap )
|
wxGridSizer::wxGridSizer( int rows, int cols, int vgap, int hgap )
|
||||||
@@ -1335,6 +1337,7 @@ wxGridSizer::wxGridSizer( int rows, int cols, int vgap, int hgap )
|
|||||||
m_vgap( vgap ),
|
m_vgap( vgap ),
|
||||||
m_hgap( hgap )
|
m_hgap( hgap )
|
||||||
{
|
{
|
||||||
|
wxASSERT(rows >= 0 && cols >= 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
wxGridSizer::wxGridSizer( int rows, int cols, const wxSize& gap )
|
wxGridSizer::wxGridSizer( int rows, int cols, const wxSize& gap )
|
||||||
@@ -1343,6 +1346,7 @@ wxGridSizer::wxGridSizer( int rows, int cols, const wxSize& gap )
|
|||||||
m_vgap( gap.GetHeight() ),
|
m_vgap( gap.GetHeight() ),
|
||||||
m_hgap( gap.GetWidth() )
|
m_hgap( gap.GetWidth() )
|
||||||
{
|
{
|
||||||
|
wxASSERT(rows >= 0 && cols >= 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
wxSizerItem *wxGridSizer::DoInsert(size_t index, wxSizerItem *item)
|
wxSizerItem *wxGridSizer::DoInsert(size_t index, wxSizerItem *item)
|
||||||
|
Reference in New Issue
Block a user