From f2f38edc2c6f96565ca871a74e5717ff631b9f08 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 25 Jul 2004 17:12:28 +0000 Subject: [PATCH] invalidate selection when deleting the page changes its index (replaces patch 865500) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28496 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/gtk/notebook.cpp | 2 +- src/gtk1/notebook.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gtk/notebook.cpp b/src/gtk/notebook.cpp index 1e73e040c1..b7f8177a6f 100644 --- a/src/gtk/notebook.cpp +++ b/src/gtk/notebook.cpp @@ -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; diff --git a/src/gtk1/notebook.cpp b/src/gtk1/notebook.cpp index 1e73e040c1..b7f8177a6f 100644 --- a/src/gtk1/notebook.cpp +++ b/src/gtk1/notebook.cpp @@ -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; -- 2.45.2