From fea2689d5c0b3679b533207cb91f7db584269eef Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 19 Nov 2013 14:15:27 +0000 Subject: [PATCH] Fix swapping items client data in wxEditableListBox. Use wxUIntPtr, not long, and SetItemPtrData() instead of SetItemData(), to ensure that we preserve the values of client data pointers in 64 bit build, otherwise they were truncated to 32 bits. Closes #15687. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75248 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/generic/editlbox.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/generic/editlbox.cpp b/src/generic/editlbox.cpp index 6502d4bfa8..a236e62f59 100644 --- a/src/generic/editlbox.cpp +++ b/src/generic/editlbox.cpp @@ -378,10 +378,10 @@ void wxEditableListBox::SwapItems(long i1, long i2) m_listCtrl->SetItemText(i2, t1); // swap the item data - long d1 = m_listCtrl->GetItemData(i1); - long d2 = m_listCtrl->GetItemData(i2); - m_listCtrl->SetItemData(i1, d2); - m_listCtrl->SetItemData(i2, d1); + wxUIntPtr d1 = m_listCtrl->GetItemData(i1); + wxUIntPtr d2 = m_listCtrl->GetItemData(i2); + m_listCtrl->SetItemPtrData(i1, d2); + m_listCtrl->SetItemPtrData(i2, d1); }