git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38910
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
wxColour wxXmlResourceHandler::GetColour(const wxString& param)
{
wxString v = GetParamValue(param);
wxColour wxXmlResourceHandler::GetColour(const wxString& param)
{
wxString v = GetParamValue(param);
- // find colour using HTML syntax (#RRGGBB)
- unsigned long tmp = 0;
-
- if (v.length() != 7 || v[0u] != wxT('#') ||
- wxSscanf(v.c_str(), wxT("#%lX"), &tmp) != 1)
+ // wxString -> wxColour conversion
+ if (!clr.Set(v))
{
// the colour doesn't use #RRGGBB format, check if it is symbolic
// colour name:
{
// the colour doesn't use #RRGGBB format, check if it is symbolic
// colour name:
- wxColour clr = GetSystemColour(v);
+ clr = GetSystemColour(v);
if (clr.Ok())
return clr;
if (clr.Ok())
return clr;
- return wxColour((unsigned char) ((tmp & 0xFF0000) >> 16) ,
- (unsigned char) ((tmp & 0x00FF00) >> 8),
- (unsigned char) ((tmp & 0x0000FF)));