From 596399f2ec286b956cac64d0e590dcbc6e51804a Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 19 May 2016 22:05:11 +0200 Subject: [PATCH] Remove wxLogDebug() from wxColour::FromString() Just returning false is enough, there is no need to log a debug message as well. Also simplify the logic of this function a little by always returning true at the end and returning false before on failure. Closes #13759. --- src/common/colourcmn.cpp | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/common/colourcmn.cpp b/src/common/colourcmn.cpp index fb193c3898..a27e3b56cb 100644 --- a/src/common/colourcmn.cpp +++ b/src/common/colourcmn.cpp @@ -176,17 +176,19 @@ bool wxColourBase::FromString(const wxString& str) // because this place can be called from constructor // and 'this' could not be available yet wxColour clr = wxTheColourDatabase->Find(str); - if (clr.IsOk()) - Set((unsigned char)clr.Red(), - (unsigned char)clr.Green(), - (unsigned char)clr.Blue()); + if (!clr.IsOk()) + return false; + + Set((unsigned char)clr.Red(), + (unsigned char)clr.Green(), + (unsigned char)clr.Blue()); + } + else // unrecognized + { + return false; } - if (IsOk()) - return true; - - wxLogDebug(wxT("wxColour::Set - couldn't set to colour string '%s'"), str); - return false; + return true; } wxString wxColourBase::GetAsString(long flags) const