]> git.saurik.com Git - wxWidgets.git/commitdiff
Fix item data access in wxDataViewListCtrl.
authorVadim Zeitlin <vadim@wxwidgets.org>
Thu, 12 Jul 2012 18:34:18 +0000 (18:34 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Thu, 12 Jul 2012 18:34:18 +0000 (18:34 +0000)
Map items to rows correctly, just using wxPtrToUInt()-1 is not the right thing
to do if any items were deleted or changed.

Closes #14479.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72048 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

docs/changes.txt
src/common/datavcmn.cpp

index e05f13fffe74804e46ade0b5112721191502a54e..df139d41d01f6f8ae77a2c5b559299d045dd8f24 100644 (file)
@@ -524,7 +524,14 @@ Major new features in this release
   was added.
 
 
-2.9.4: (release 2012-07-09)
+2.9.5: (released ????-??-??)
+
+All (GUI):
+
+- Fix item data access in wxDataViewListCtrl (Kry).
+
+
+2.9.4: (released 2012-07-09)
 ------
 
 INCOMPATIBLE CHANGES SINCE 2.9.3
index 1dcf8a10053c258c9d119d90422b9e37ca83673e..881fc24cd1248a79d0e4f02a43447695eb04a8f3 100644 (file)
@@ -1768,7 +1768,7 @@ void wxDataViewListStore::DeleteAllItems()
 
 void wxDataViewListStore::SetItemData( const wxDataViewItem& item, wxUIntPtr data )
 {
-    wxDataViewListStoreLine* line = m_data[wxPtrToUInt( item.GetID() ) - 1];
+    wxDataViewListStoreLine* line = m_data[GetRow(item)];
     if (!line) return;
 
     line->SetData( data );
@@ -1776,7 +1776,7 @@ void wxDataViewListStore::SetItemData( const wxDataViewItem& item, wxUIntPtr dat
 
 wxUIntPtr wxDataViewListStore::GetItemData( const wxDataViewItem& item ) const
 {
-    wxDataViewListStoreLine* line = m_data[wxPtrToUInt( item.GetID() ) - 1];
+    wxDataViewListStoreLine* line = m_data[GetRow(item)];
     if (!line) return static_cast<wxUIntPtr>(NULL);
 
     return line->GetData();