From 7d36b02bcc190a309d013f107701b16c6aca8828 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 28 Jan 2019 18:59:34 +0100 Subject: [PATCH] Reuse base class helper in wxGTK wxNotebook::InsertPage() Call DoSetSelectionAfterInsertion() instead of partially duplicating it. This ensures that m_selection is correct after inserting a new page, which wasn't the case before. Surprisingly, this didn't actually matter because wxGTK implementation doesn't really use the base class m_selection neither and just queries GTK+ widget directly for its selection in GetSelection() instead, but it was at the very least confusing. --- src/gtk/notebook.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/gtk/notebook.cpp b/src/gtk/notebook.cpp index 4e86999f34..a47d136a1e 100644 --- a/src/gtk/notebook.cpp +++ b/src/gtk/notebook.cpp @@ -483,10 +483,7 @@ bool wxNotebook::InsertPage( size_t position, } #endif - if (select && GetPageCount() > 1) - { - SetSelection( position ); - } + DoSetSelectionAfterInsertion(position, select); InvalidateBestSize(); return true;