Revert change to m_order assignment in wxRearrangeList::Create()

This partially reverts 7e1b64a2eb as it
broke wxRearrangeList because assigning to m_order[n] used an
out-of-range index.

Another possible fix would be to replace reserve() call added in that
commit with resize(), but there doesn't seem to be any advantage in
assigning elements one by one, rather than all at once, as it had been
done before, so just revert this change instead.

See #17836.
This commit is contained in:
Vadim Zeitlin
2018-12-23 17:12:26 +01:00
parent a6dc3c78ab
commit 2c737bfbc0

View File

@@ -70,7 +70,6 @@ bool wxRearrangeList::Create(wxWindow *parent,
}
// do create the real control
m_order.reserve(count);
if ( !wxCheckListBox::Create(parent, id, pos, size, itemsInOrder,
style, validator, name) )
return false;
@@ -84,9 +83,10 @@ bool wxRearrangeList::Create(wxWindow *parent,
// which would also update m_order itself.
wxCheckListBox::Check(n);
}
m_order[n] = order[n];
}
m_order = order;
return true;
}