From d3ad397447579168fc51647eb4284dafc2285e97 Mon Sep 17 00:00:00 2001 From: Paul Cornett Date: Mon, 23 Jun 2008 17:43:09 +0000 Subject: [PATCH] avoid setting a negative window size git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@54337 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/generic/srchctlg.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/generic/srchctlg.cpp b/src/generic/srchctlg.cpp index 49b469f033..fd18cb07ea 100644 --- a/src/generic/srchctlg.cpp +++ b/src/generic/srchctlg.cpp @@ -532,6 +532,8 @@ void wxSearchCtrl::LayoutControls(int x, int y, int width, int height) y += BORDER; width -= horizontalBorder*2; height -= BORDER*2; + if (width < 0) width = 0; + if (height < 0) height = 0; wxSize sizeSearch(0,0); wxSize sizeCancel(0,0); @@ -558,6 +560,7 @@ void wxSearchCtrl::LayoutControls(int x, int y, int width, int height) cancelMargin = 0; } wxCoord textWidth = width - sizeSearch.x - sizeCancel.x - searchMargin - cancelMargin - 1; + if (textWidth < 0) textWidth = 0; // position the subcontrols inside the client area -- 2.45.2