]> git.saurik.com Git - wxWidgets.git/commitdiff
avoid setting negative window sizes
authorPaul Cornett <paulcor@bullseye.com>
Thu, 1 Apr 2010 17:00:44 +0000 (17:00 +0000)
committerPaul Cornett <paulcor@bullseye.com>
Thu, 1 Apr 2010 17:00:44 +0000 (17:00 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63818 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/ribbon/art_aui.cpp
src/ribbon/art_msw.cpp
src/ribbon/page.cpp

index 6a5df2529db1907407329c74519a68c4516030b9..1847f583c136d47753b09afac5968daccf8f46e8 100644 (file)
@@ -637,6 +637,8 @@ wxSize wxRibbonAUIArtProvider::GetPanelClientSize(
         if(client_offset)
             *client_offset = wxPoint(3, label_height + 2);
     }
+    if (size.x < 0) size.x = 0;
+    if (size.y < 0) size.y = 0;
     return size;
 }
 
index 32d0e2acdb050cf13dd4004b00a42c69810036ca..3b147d8fa9b11d57bdee539bedd6bf8b6f992dfd 100644 (file)
@@ -2446,6 +2446,8 @@ wxSize wxRibbonMSWArtProvider::GetPanelClientSize(
         else
             *client_offset = wxPoint(3, 2);
     }
+    if (size.x < 0) size.x = 0;
+    if (size.y < 0) size.y = 0;
 
     return size;
 }
index fcca24e37bcd6df5783fb103fd0f9892d113dd94..5e7562f4a089652f5a1d4d2fc2e3b20e64bd6ad0 100644 (file)
@@ -539,6 +539,7 @@ bool wxRibbonPage::DoActualLayout()
         minor_axis_size = GetSize().GetWidth() - origin.x - m_art->GetMetric(wxRIBBON_ART_PAGE_BORDER_RIGHT_SIZE);
         available_space = m_size_in_major_axis_for_children - m_art->GetMetric(wxRIBBON_ART_PAGE_BORDER_BOTTOM_SIZE) - origin.y;
     }
+    if (minor_axis_size < 0) minor_axis_size = 0;
     size_t size_index;
     for(size_index = 0; size_index < m_size_calc_array_size; ++size_index)
     {