From 7546ba03f31e126bf4b117b6f9b1515a73ee9fc7 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 30 Mar 2007 16:37:31 +0000 Subject: [PATCH] don't pass potentially negative index to SetSelection() git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45162 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/aui/auibook.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/aui/auibook.cpp b/src/aui/auibook.cpp index 8813881c6f..f0763f94f1 100644 --- a/src/aui/auibook.cpp +++ b/src/aui/auibook.cpp @@ -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(); } -- 2.45.2