Ignore attempts to set order of empty wxMSWHeaderCtrl
This can happen when using wxGrid and calling UseNativeColHeader() before adding any columns and shouldn't be fatal, so simply don't do anything in this case.
This commit is contained in:
@@ -540,6 +540,13 @@ void wxMSWHeaderCtrl::DoInsertItem(const wxHeaderColumn& col, unsigned int idx)
|
|||||||
|
|
||||||
void wxMSWHeaderCtrl::SetColumnsOrder(const wxArrayInt& order)
|
void wxMSWHeaderCtrl::SetColumnsOrder(const wxArrayInt& order)
|
||||||
{
|
{
|
||||||
|
// This can happen if we don't have any columns at all and "order" is empty
|
||||||
|
// anyhow in this case, so we don't have anything to do (note that we
|
||||||
|
// already know that the input array contains m_numColumns elements, as
|
||||||
|
// it's checked by the public SetColumnsOrder()).
|
||||||
|
if ( !m_numColumns )
|
||||||
|
return;
|
||||||
|
|
||||||
wxArrayInt orderShown;
|
wxArrayInt orderShown;
|
||||||
orderShown.reserve(m_numColumns);
|
orderShown.reserve(m_numColumns);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user