]> git.saurik.com Git - wxWidgets.git/commitdiff
don't pass potentially negative index to SetSelection()
authorVadim Zeitlin <vadim@wxwidgets.org>
Fri, 30 Mar 2007 16:37:31 +0000 (16:37 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Fri, 30 Mar 2007 16:37:31 +0000 (16:37 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45162 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/aui/auibook.cpp

index 8813881c6fdbb431689bceb6034aecdbbe2e2f4a..f0763f94f1e0b33a9ee0b0f453c0f47845ad89f5 100644 (file)
@@ -3070,7 +3070,15 @@ void wxAuiNotebook::Split(size_t page, int direction)
     m_curpage = -1;
 
     // set the active page to the one we just split off
-    SetSelection(m_tabs.GetIdxFromWindow(page_info.window));
+    int idx = m_tabs.GetIdxFromWindow(page_info.window);
+    if ( idx != wxNOT_FOUND )
+    {
+        SetSelection(idx);
+    }
+    else
+    {
+        wxFAIL_MSG( _T("just inserted window not found") );
+    }
 
     UpdateHintWindowSize();
 }