]> git.saurik.com Git - wxWidgets.git/commitdiff
Remove asserts in wxChoicebook::Get/SetPageImage().
authorVadim Zeitlin <vadim@wxwidgets.org>
Tue, 15 Dec 2009 21:12:06 +0000 (21:12 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Tue, 15 Dec 2009 21:12:06 +0000 (21:12 +0000)
It's better to silently return an error code than assert when these methods
are called as their failure is relatively harmless and the user code may call
them via base class pointer without caring if it works with a control which
supports images or not.

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

src/generic/choicbkg.cpp

index c21023c25ba01f130c7d93b87031d3023e579629..731ff90cabc313b147741cc7338b33f6bc6e45db 100644 (file)
@@ -176,14 +176,16 @@ wxString wxChoicebook::GetPageText(size_t n) const
 
 int wxChoicebook::GetPageImage(size_t WXUNUSED(n)) const
 {
-    wxFAIL_MSG( wxT("wxChoicebook::GetPageImage() not implemented") );
-
     return wxNOT_FOUND;
 }
 
 bool wxChoicebook::SetPageImage(size_t WXUNUSED(n), int WXUNUSED(imageId))
 {
-    wxFAIL_MSG( wxT("wxChoicebook::SetPageImage() not implemented") );
+    // fail silently, the code may be written to use one of several book
+    // classes and call SetPageImage() unconditionally, it's better to just
+    // ignore it (which is the best we can do short of rewriting this class to
+    // use wxBitmapComboBox anyhow) than complain loudly about a rather
+    // harmless problem
 
     return false;
 }