Prevent possible divide by zero problem

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@23717 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2003-09-19 20:27:11 +00:00
parent 3e01b8d2cb
commit bbb24b614a

View File

@@ -731,6 +731,8 @@ wxGridSizer::wxGridSizer( int rows, int cols, int vgap, int hgap )
m_cols = cols;
m_vgap = vgap;
m_hgap = hgap;
if (m_rows == 0 && m_cols == 0)
m_rows = 1;
}
wxGridSizer::wxGridSizer( int cols, int vgap, int hgap )
@@ -739,6 +741,8 @@ wxGridSizer::wxGridSizer( int cols, int vgap, int hgap )
m_cols = cols;
m_vgap = vgap;
m_hgap = hgap;
if (m_rows == 0 && m_cols == 0)
m_rows = 1;
}
int wxGridSizer::CalcRowsCols(int& nrows, int& ncols) const