X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/681be2ef80274e6c39b243922a594c59e4983dab..404b319a85dadd7decf7a5a5331020520031a41c:/src/generic/choicbkg.cpp 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; }