]> git.saurik.com Git - wxWidgets.git/commitdiff
Check for an image list before complaining in OnGetItemImage
authorRobin Dunn <robin@alldunn.com>
Fri, 8 Oct 2004 16:14:41 +0000 (16:14 +0000)
committerRobin Dunn <robin@alldunn.com>
Fri, 8 Oct 2004 16:14:41 +0000 (16:14 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29733 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/generic/listctrl.cpp
src/msw/listctrl.cpp

index e5b8353e680383170b40104011323fe5075f6d93..7ef33c834116f30bbb65253fe7f22c8e55b3a9c5 100644 (file)
@@ -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;
 }
 
index 8022ba2992ffe2b791c36173e0fe825453505685..302d90a5eab13a2410a52ded4cbe283524f8d47a 100644 (file)
@@ -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;
 }