]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/choicbkg.cpp
Fix harmless unused parameter warning in !wxUSE_GRAPHICS_CONTEXT build.
[wxWidgets.git] / src / generic / choicbkg.cpp
index c8b2c5acf5537fe3ddcdab750f01226eb4f7be66..5c0ac7a514c18a95e9fe4f2296ef52d6e48aea67 100644 (file)
@@ -209,22 +209,7 @@ wxWindow *wxChoicebook::DoRemovePage(size_t page)
     {
         GetChoiceCtrl()->Delete(page);
 
     {
         GetChoiceCtrl()->Delete(page);
 
-        if ( m_selection >= (int)page )
-        {
-            // ensure that the selection is valid
-            int sel;
-            if ( GetPageCount() == 0 )
-                sel = wxNOT_FOUND;
-            else
-                sel = m_selection ? m_selection - 1 : 0;
-
-            // if deleting current page we shouldn't try to hide it
-            m_selection = m_selection == (int)page ? wxNOT_FOUND
-                                                   : m_selection - 1;
-
-            if ( sel != wxNOT_FOUND && sel != m_selection )
-                SetSelection(sel);
-        }
+        DoSetSelectionAfterRemoval(page);
     }
 
     return win;
     }
 
     return win;