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:
@@ -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
|
||||
|
Reference in New Issue
Block a user