]> git.saurik.com Git - wxWidgets.git/commitdiff
don't call SetSize() twice in ResizeChild(), this is useless
authorVadim Zeitlin <vadim@wxwidgets.org>
Thu, 24 Mar 2005 23:35:42 +0000 (23:35 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Thu, 24 Mar 2005 23:35:42 +0000 (23:35 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@33039 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

contrib/src/gizmos/dynamicsash.cpp

index f8d5980143240b8efe7058d81ddbae021fb6931d..a88c427f19cff8a78c832082f10d55a77f67269c 100644 (file)
@@ -192,7 +192,7 @@ public:
     bool Create();
     void AddChild(wxWindow *window);
     DynamicSashRegion GetRegion(int x, int y);
-    void ResizeChild(wxSize size);
+    void ResizeChild(const wxSize& size);
     wxScrollBar *FindScrollBar(const wxWindow *child, int vert) const;
 
     void OnSize(wxSizeEvent &event);
@@ -1159,22 +1159,17 @@ DynamicSashRegion wxDynamicSashWindowLeaf::GetRegion(int x, int y)
     return DSR_NONE;
 }
 
-void wxDynamicSashWindowLeaf::ResizeChild(wxSize size)
+void wxDynamicSashWindowLeaf::ResizeChild(const wxSize& size)
 {
     if (m_child)
     {
-        if (m_impl->m_window->GetWindowStyle() & wxDS_MANAGE_SCROLLBARS)
+        if (m_impl->m_window->HasFlag(wxDS_MANAGE_SCROLLBARS))
         {
-            m_child->SetSize(size);
             wxSize best_size = m_child->GetBestSize();
             if (best_size.GetWidth() < size.GetWidth())
-            {
                 best_size.SetWidth(size.GetWidth());
-            }
             if (best_size.GetHeight() < size.GetHeight())
-            {
                 best_size.SetHeight(size.GetHeight());
-            }
             m_child->SetSize(best_size);
 
             int hpos = m_hscroll->GetThumbPosition();
@@ -1202,7 +1197,7 @@ void wxDynamicSashWindowLeaf::ResizeChild(wxSize size)
             wxPoint pos = m_child->GetPosition();
             m_viewport->ScrollWindow(-hpos - pos.x, -vpos - pos.y);
         }
-        else
+        else // !wxDS_MANAGE_SCROLLBARS
         {
             m_child->SetSize(size);
         }