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.
This commit is contained in:
Vadim Zeitlin
2019-01-28 18:59:34 +01:00
parent 7cd6a27e16
commit 7d36b02bcc

View File

@@ -483,10 +483,7 @@ bool wxNotebook::InsertPage( size_t position,
}
#endif
if (select && GetPageCount() > 1)
{
SetSelection( position );
}
DoSetSelectionAfterInsertion(position, select);
InvalidateBestSize();
return true;