]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/listbkg.cpp
non-pch build fix
[wxWidgets.git] / src / generic / listbkg.cpp
index fddedd14ae50075824234d19924c863199a4d5d8..0861211c0eeb4ab6d3d08253c9b03a0565d990db 100644 (file)
@@ -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;