Fix discrepancy between different ways of measuring text extents under Mac.
[wxWidgets.git] / src / msw / listctrl.cpp
index 49204c2a0520708d108dd1685941f3f70943c984..52bf721d5ee5cb12edad7b0ee562e16d7e35a36e 100644 (file)
@@ -224,11 +224,6 @@ public:
     wxDECLARE_NO_COPY_CLASS(wxMSWListItemData);
 };
 
-// Get the internal data structure
-static wxMSWListItemData *wxGetInternalData(HWND hwnd, long itemId);
-static wxMSWListItemData *wxGetInternalData(const wxListCtrl *ctl, long itemId);
-
-
 #if wxUSE_EXTENDED_RTTI
 WX_DEFINE_FLAGS( wxListCtrlStyle )
 
@@ -1758,7 +1753,10 @@ long wxListCtrl::InsertItem(const wxListItem& info)
         }
     }
 
-    long rv = ListView_InsertItem(GetHwnd(), & item);
+    const long rv = ListView_InsertItem(GetHwnd(), & item);
+
+    // failing to insert the item is really unexpected
+    wxCHECK_MSG( rv != -1, rv, "failed to insert an item in wxListCtrl" );
 
     m_count++;
     wxASSERT_MSG( m_count == ListView_GetItemCount(GetHwnd()),