Fix crash when updating art provider of a ribbon with scroll buttons
Don't leave the scroll buttons with the old, possibly soon to be deleted, art
provider pointer.
See #17441.
(cherry picked from commit 6e5a2b630a
)
This commit is contained in:
@@ -224,6 +224,14 @@ void wxRibbonPage::SetArtProvider(wxRibbonArtProvider* art)
|
||||
ribbon_child->SetArtProvider(art);
|
||||
}
|
||||
}
|
||||
|
||||
// The scroll buttons are children of the parent ribbon control, not the
|
||||
// page, so they're not taken into account by the loop above, but they
|
||||
// still use the same art provider, so we need to update them too.
|
||||
if ( m_scroll_left_btn )
|
||||
m_scroll_left_btn->SetArtProvider(art);
|
||||
if ( m_scroll_right_btn )
|
||||
m_scroll_right_btn->SetArtProvider(art);
|
||||
}
|
||||
|
||||
void wxRibbonPage::AdjustRectToIncludeScrollButtons(wxRect* rect) const
|
||||
|
Reference in New Issue
Block a user