]> git.saurik.com Git - wxWidgets.git/commitdiff
Prevent possible divide by zero problem
authorRobin Dunn <robin@alldunn.com>
Fri, 19 Sep 2003 20:27:11 +0000 (20:27 +0000)
committerRobin Dunn <robin@alldunn.com>
Fri, 19 Sep 2003 20:27:11 +0000 (20:27 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@23717 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/sizer.cpp

index a711c7b0c2b75181f7f63e39569eb6ff5cb4973e..3ba28288ecc151ca0095556171a81f5e535b1c28 100644 (file)
@@ -914,6 +914,8 @@ wxGridSizer::wxGridSizer( int rows, int cols, int vgap, int hgap )
     , m_vgap( vgap )
     , m_hgap( hgap )
 {
+    if (m_rows == 0 && m_cols == 0)
+        m_rows = 1;
 }
 
 wxGridSizer::wxGridSizer( int cols, int vgap, int hgap )
@@ -922,6 +924,8 @@ wxGridSizer::wxGridSizer( int cols, int vgap, int hgap )
     , m_vgap( vgap )
     , m_hgap( hgap )
 {
+    if (m_rows == 0 && m_cols == 0)
+        m_rows = 1;
 }
 
 int wxGridSizer::CalcRowsCols(int& nrows, int& ncols) const