From 611a725ecd1dd7b35c5659d1d7cabe38d860a1e1 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Fri, 8 Oct 2004 16:14:41 +0000 Subject: [PATCH] Check for an image list before complaining in OnGetItemImage git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29733 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/generic/listctrl.cpp | 6 +++--- src/msw/listctrl.cpp | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/generic/listctrl.cpp b/src/generic/listctrl.cpp index e5b8353e68..7ef33c8341 100644 --- a/src/generic/listctrl.cpp +++ b/src/generic/listctrl.cpp @@ -5383,9 +5383,9 @@ wxString wxGenericListCtrl::OnGetItemText(long WXUNUSED(item), long WXUNUSED(col int wxGenericListCtrl::OnGetItemImage(long WXUNUSED(item)) const { - // same as above - wxFAIL_MSG( _T("wxGenericListCtrl::OnGetItemImage not supposed to be called") ); - + wxCHECK_MSG(!GetImageList(wxIMAGE_LIST_SMALL), + -1, + wxT("List control has an image list, OnGetItemImage should be overridden.")); return -1; } diff --git a/src/msw/listctrl.cpp b/src/msw/listctrl.cpp index 8022ba2992..302d90a5ea 100644 --- a/src/msw/listctrl.cpp +++ b/src/msw/listctrl.cpp @@ -2376,9 +2376,9 @@ wxString wxListCtrl::OnGetItemText(long WXUNUSED(item), long WXUNUSED(col)) cons int wxListCtrl::OnGetItemImage(long WXUNUSED(item)) const { - // same as above - wxFAIL_MSG( _T("wxListCtrl::OnGetItemImage not supposed to be called") ); - + wxCHECK_MSG(!GetImageList(wxIMAGE_LIST_SMALL), + -1, + wxT("List control has an image list, OnGetItemImage should be overridden.")); return -1; } -- 2.45.2