From c15cc7fa26aca73d2eab742e3d4f2e633c1af455 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 15 Dec 2009 21:12:06 +0000 Subject: [PATCH] Remove asserts in wxChoicebook::Get/SetPageImage(). 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 | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/generic/choicbkg.cpp b/src/generic/choicbkg.cpp index c21023c25b..731ff90cab 100644 --- a/src/generic/choicbkg.cpp +++ b/src/generic/choicbkg.cpp @@ -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; } -- 2.45.2