From f2e9e3b4b74b5ea9eb5ed05f9da21c62526d4fcf Mon Sep 17 00:00:00 2001 From: Paul Cornett Date: Thu, 13 Feb 2014 16:47:17 +0000 Subject: [PATCH] avoid setting negative window size, see #15976 git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75883 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/aui/auibook.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/aui/auibook.cpp b/src/aui/auibook.cpp index 29a06eabf7..7177109686 100644 --- a/src/aui/auibook.cpp +++ b/src/aui/auibook.cpp @@ -1552,19 +1552,22 @@ public: // results in assert failures/GTK+ warnings height = 0; } + int width = m_rect.width - 2 * border_space; + if (width < 0) + width = 0; if (m_tabs->GetFlags() & wxAUI_NB_BOTTOM) { page.window->SetSize(m_rect.x + border_space, m_rect.y + border_space, - m_rect.width - 2 * border_space, + width, height); } else //TODO: if (GetFlags() & wxAUI_NB_TOP) { page.window->SetSize(m_rect.x + border_space, m_rect.y + m_tabCtrlHeight, - m_rect.width - 2 * border_space, + width, height); } // TODO: else if (GetFlags() & wxAUI_NB_LEFT){}