From 2c737bfbc04dec2da6d14e5007e9fc8558ab22a2 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 23 Dec 2018 17:12:26 +0100 Subject: [PATCH] Revert change to m_order assignment in wxRearrangeList::Create() This partially reverts 7e1b64a2eb6ef5b0ad3dc5b77c8102ff86315a75 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. --- src/common/rearrangectrl.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/rearrangectrl.cpp b/src/common/rearrangectrl.cpp index 75170d35dc..ef917518f1 100644 --- a/src/common/rearrangectrl.cpp +++ b/src/common/rearrangectrl.cpp @@ -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; }