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:
@@ -483,10 +483,7 @@ bool wxNotebook::InsertPage( size_t position,
|
||||
}
|
||||
#endif
|
||||
|
||||
if (select && GetPageCount() > 1)
|
||||
{
|
||||
SetSelection( position );
|
||||
}
|
||||
DoSetSelectionAfterInsertion(position, select);
|
||||
|
||||
InvalidateBestSize();
|
||||
return true;
|
||||
|
Reference in New Issue
Block a user