From 16eac072eb0d3af2ce40cc507946ae83fd6f16c9 Mon Sep 17 00:00:00 2001 From: Paul Cornett Date: Thu, 1 Apr 2010 17:00:44 +0000 Subject: [PATCH] avoid setting negative window sizes git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63818 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/ribbon/art_aui.cpp | 2 ++ src/ribbon/art_msw.cpp | 2 ++ src/ribbon/page.cpp | 1 + 3 files changed, 5 insertions(+) diff --git a/src/ribbon/art_aui.cpp b/src/ribbon/art_aui.cpp index 6a5df2529d..1847f583c1 100644 --- a/src/ribbon/art_aui.cpp +++ b/src/ribbon/art_aui.cpp @@ -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; } diff --git a/src/ribbon/art_msw.cpp b/src/ribbon/art_msw.cpp index 32d0e2acdb..3b147d8fa9 100644 --- a/src/ribbon/art_msw.cpp +++ b/src/ribbon/art_msw.cpp @@ -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; } diff --git a/src/ribbon/page.cpp b/src/ribbon/page.cpp index fcca24e37b..5e7562f4a0 100644 --- a/src/ribbon/page.cpp +++ b/src/ribbon/page.cpp @@ -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) { -- 2.45.2