]> git.saurik.com Git - wxWidgets.git/commitdiff
Use wxSize::IncTo() in wxBookCtrlBase::DoGetBestSize().
authorVadim Zeitlin <vadim@wxwidgets.org>
Thu, 27 Sep 2012 12:47:17 +0000 (12:47 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Thu, 27 Sep 2012 12:47:17 +0000 (12:47 +0000)
No changes, just use an existing wxSize method instead of reimplementing it in
the loop over the pages in wxBookCtrlBase.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72562 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/bookctrl.cpp

index 3b1bfc6d1c8fe2d64670b7542ffeeda71d7d1e35..6ab3784e11574d9f2ba4836ecf323b7b32259c66 100644 (file)
@@ -148,16 +148,8 @@ wxSize wxBookCtrlBase::DoGetBestSize() const
         for ( size_t nPage = 0; nPage < nCount; nPage++ )
         {
             const wxWindow * const pPage = m_pages[nPage];
-            if( pPage )
-            {
-                wxSize childBestSize(pPage->GetBestSize());
-
-                if ( childBestSize.x > bestSize.x )
-                    bestSize.x = childBestSize.x;
-
-                if ( childBestSize.y > bestSize.y )
-                    bestSize.y = childBestSize.y;
-            }
+            if ( pPage )
+                bestSize.IncTo(pPage->GetBestSize());
         }
     }