X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/681be2ef80274e6c39b243922a594c59e4983dab..7d6a4d96961eac84d05db8bb24c64d39003f6e54:/src/generic/choicbkg.cpp?ds=sidebyside diff --git a/src/generic/choicbkg.cpp b/src/generic/choicbkg.cpp index 09e9465ffd..52fd088591 100644 --- a/src/generic/choicbkg.cpp +++ b/src/generic/choicbkg.cpp @@ -195,20 +195,9 @@ wxChoicebook::InsertPage(size_t n, GetChoiceCtrl()->Select(m_selection); } - // some page should be selected: either this one or the first one if there - // is still no selection - int selNew = wxNOT_FOUND; - if ( bSelect ) - selNew = n; - else if ( m_selection == wxNOT_FOUND ) - selNew = 0; - - if ( selNew != m_selection ) + if ( !DoSetSelectionAfterInsertion(n, bSelect) ) page->Hide(); - if ( selNew != wxNOT_FOUND ) - SetSelection(selNew); - return true; }