From 2d5e5799a9af71438b38fa659eaa98d1f423a4a3 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 16 Oct 2009 14:35:21 +0000 Subject: [PATCH] Make assert in wxMSW wxListCtrl::InsertItem() more informative. Assert if inserting an item failed (this is really unexpected and must be a programmer error) instead of asserting about items number mismatch -- which might be true but only indirectly helpful. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62429 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/listctrl.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/msw/listctrl.cpp b/src/msw/listctrl.cpp index 93eebf755c..52bf721d5e 100644 --- a/src/msw/listctrl.cpp +++ b/src/msw/listctrl.cpp @@ -1753,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()), -- 2.45.2