]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/listbkg.cpp
Fix compiler warnings in the IE backend.
[wxWidgets.git] / src / generic / listbkg.cpp
index d297ff31f3fb4fe7ac7d89f9c5b9237294536f59..0861211c0eeb4ab6d3d08253c9b03a0565d990db 100644 (file)
@@ -85,11 +85,6 @@ END_EVENT_TABLE()
 // wxListbook creation
 // ----------------------------------------------------------------------------
 
-void wxListbook::Init()
-{
-    m_selection = wxNOT_FOUND;
-}
-
 bool
 wxListbook::Create(wxWindow *parent,
                    wxWindowID id,
@@ -311,11 +306,6 @@ void wxListbook::UpdateSelectedPage(size_t newsel)
     GetListView()->Focus(newsel);
 }
 
-int wxListbook::GetSelection() const
-{
-    return m_selection;
-}
-
 wxBookCtrlEvent* wxListbook::CreatePageChangingEvent() const
 {
     return new wxBookCtrlEvent(wxEVT_COMMAND_LISTBOOK_PAGE_CHANGING, m_windowId);
@@ -353,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;
@@ -411,8 +390,6 @@ bool wxListbook::DeleteAllPages()
     if (!wxBookCtrlBase::DeleteAllPages())
         return false;
 
-    m_selection = -1;
-
     UpdateSize();
 
     return true;