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.
This commit is contained in:
Vadim Zeitlin
2016-05-19 22:05:11 +02:00
parent 5817911863
commit 596399f2ec

View File

@@ -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