From cbc751bc56d54d7113c6a6078e893245472e993b Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 24 Jul 2010 12:27:34 +0000 Subject: [PATCH] Don't show empty sizers. Revert the change of r44514 and do hide the empty sizers. Code relying on them being shown/positioned should use wxRESERVE_SPACE_EVEN_IF_HIDDEN flag but assuming it by default results in completely unexpected layouts, e.g. still using margins around a sizer with hidden window if it contains an empty sub-sizer. Closes #11426. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65079 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/sizer.cpp | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/src/common/sizer.cpp b/src/common/sizer.cpp index badc6724ab..a6b6b4920b 100644 --- a/src/common/sizer.cpp +++ b/src/common/sizer.cpp @@ -585,20 +585,13 @@ bool wxSizerItem::IsShown() const // arbitrarily decide that if at least one of our elements is // shown, so are we (this arbitrariness is the reason for // deprecating this function) + for ( wxSizerItemList::compatibility_iterator + node = m_sizer->GetChildren().GetFirst(); + node; + node = node->GetNext() ) { - // Some apps (such as dialog editors) depend on an empty sizer still - // being laid out correctly and reporting the correct size and position. - if (m_sizer->GetChildren().GetCount() == 0) + if ( node->GetData()->IsShown() ) return true; - - for ( wxSizerItemList::compatibility_iterator - node = m_sizer->GetChildren().GetFirst(); - node; - node = node->GetNext() ) - { - if ( node->GetData()->IsShown() ) - return true; - } } return false; -- 2.45.2