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.

Closes #17441.
This commit is contained in:
zhivko
2016-03-15 20:22:30 +01:00
committed by Vadim Zeitlin
parent 21d8fd8677
commit 6e5a2b630a

View File

@@ -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