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
This commit is contained in:
Vadim Zeitlin
2007-03-30 16:37:31 +00:00
parent 8fee630648
commit 7546ba03f3

View 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();
}