]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/sizer.cpp
IsShown shouldn't cause empty sizers to not have their positions calculated
[wxWidgets.git] / src / common / sizer.cpp
index d4ac29a51747c1e056d3208a12f769c51e357d6e..84473ce9ccde1759eb8c5755304b2abb0fd83b23 100644 (file)
@@ -460,6 +460,11 @@ bool wxSizerItem::IsShown() const
             // shown, so are we (this arbitrariness is the reason for
             // deprecating this function)
             {
+                // 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)
+                    return true;
+
                 for ( wxSizerItemList::compatibility_iterator
                         node = m_sizer->GetChildren().GetFirst();
                       node;