From: Vadim Zeitlin Date: Thu, 27 Sep 2012 12:47:17 +0000 (+0000) Subject: Use wxSize::IncTo() in wxBookCtrlBase::DoGetBestSize(). X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/602af335e44205356aef7b30c52640040dcae207 Use wxSize::IncTo() in wxBookCtrlBase::DoGetBestSize(). 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 --- diff --git a/src/common/bookctrl.cpp b/src/common/bookctrl.cpp index 3b1bfc6d1c..6ab3784e11 100644 --- a/src/common/bookctrl.cpp +++ b/src/common/bookctrl.cpp @@ -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()); } }