From eb1f6dd8064b8a3c6deaceea6a1fb271165da5df Mon Sep 17 00:00:00 2001 From: Paul Cornett Date: Thu, 23 Jan 2014 05:47:43 +0000 Subject: [PATCH] fix a couple GTK assertions about setting negative sizes, closes #15891 git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75688 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/combocmn.cpp | 4 +++- src/gtk/collpane.cpp | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/common/combocmn.cpp b/src/common/combocmn.cpp index 9030ff8f4a..e3933cc65f 100644 --- a/src/common/combocmn.cpp +++ b/src/common/combocmn.cpp @@ -1354,9 +1354,11 @@ void wxComboCtrlBase::PositionTextCtrl( int textCtrlXAdjust, int textCtrlYAdjust else { // If it has border, have textctrl fill the entire text field. + int w = m_tcArea.width - m_widthCustomPaint; + if (w < 0) w = 0; m_text->SetSize( m_tcArea.x + m_widthCustomPaint, m_tcArea.y, - m_tcArea.width - m_widthCustomPaint, + w, m_tcArea.height ); } } diff --git a/src/gtk/collpane.cpp b/src/gtk/collpane.cpp index ac2b928d80..386a031b9e 100644 --- a/src/gtk/collpane.cpp +++ b/src/gtk/collpane.cpp @@ -271,7 +271,9 @@ void wxCollapsiblePane::OnSize(wxSizeEvent &ev) // here we need to resize the pane window otherwise, even if the GtkExpander container // is expanded or shrunk, the pane window won't be updated! - m_pPane->SetSize(ev.GetSize().x, ev.GetSize().y - m_szCollapsed.y); + int w = ev.GetSize().y - m_szCollapsed.y; + if (w < 0) w = 0; + m_pPane->SetSize(ev.GetSize().x, w); // we need to explicitly call m_pPane->Layout() or else it won't correctly relayout // (even if SetAutoLayout(true) has been called on it!)