]> git.saurik.com Git - wxWidgets.git/commitdiff
invalidate selection when deleting the page changes its index (replaces patch 865500)
authorVadim Zeitlin <vadim@wxwidgets.org>
Sun, 25 Jul 2004 17:12:28 +0000 (17:12 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sun, 25 Jul 2004 17:12:28 +0000 (17:12 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28496 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/gtk/notebook.cpp
src/gtk1/notebook.cpp

index 1e73e040c1994a5f671e2220f63ec5642652acf3..b7f8177a6f847e578bc990b6a629c28ecc68974a 100644 (file)
@@ -566,7 +566,7 @@ bool wxNotebook::DeleteAllPages()
 
 bool wxNotebook::DeletePage( size_t page )
 {
-    if ( m_selection == (int)m_pagesData.GetCount() - 1 )
+    if ( m_selection >= page )
     {
         // the index will become invalid after the page is deleted
         m_selection = -1;
index 1e73e040c1994a5f671e2220f63ec5642652acf3..b7f8177a6f847e578bc990b6a629c28ecc68974a 100644 (file)
@@ -566,7 +566,7 @@ bool wxNotebook::DeleteAllPages()
 
 bool wxNotebook::DeletePage( size_t page )
 {
-    if ( m_selection == (int)m_pagesData.GetCount() - 1 )
+    if ( m_selection >= page )
     {
         // the index will become invalid after the page is deleted
         m_selection = -1;