X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/681be2ef80274e6c39b243922a594c59e4983dab..fc35191279b8dbdb183b2cf83f004a00069e8c44:/src/generic/listbkg.cpp?ds=sidebyside diff --git a/src/generic/listbkg.cpp b/src/generic/listbkg.cpp index fddedd14ae..0861211c0e 100644 --- a/src/generic/listbkg.cpp +++ b/src/generic/listbkg.cpp @@ -343,20 +343,9 @@ wxListbook::InsertPage(size_t n, GetListView()->Focus(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); - UpdateSize(); return true;