[ 1473731 ] 'wxColourBase and wxString <-> wxColour implementation'
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38910 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1045,16 +1045,14 @@ static wxColour GetSystemColour(const wxString& name)
|
|||||||
wxColour wxXmlResourceHandler::GetColour(const wxString& param)
|
wxColour wxXmlResourceHandler::GetColour(const wxString& param)
|
||||||
{
|
{
|
||||||
wxString v = GetParamValue(param);
|
wxString v = GetParamValue(param);
|
||||||
|
wxColour clr;
|
||||||
|
|
||||||
// find colour using HTML syntax (#RRGGBB)
|
// wxString -> wxColour conversion
|
||||||
unsigned long tmp = 0;
|
if (!clr.Set(v))
|
||||||
|
|
||||||
if (v.length() != 7 || v[0u] != wxT('#') ||
|
|
||||||
wxSscanf(v.c_str(), wxT("#%lX"), &tmp) != 1)
|
|
||||||
{
|
{
|
||||||
// the colour doesn't use #RRGGBB format, check if it is symbolic
|
// the colour doesn't use #RRGGBB format, check if it is symbolic
|
||||||
// colour name:
|
// colour name:
|
||||||
wxColour clr = GetSystemColour(v);
|
clr = GetSystemColour(v);
|
||||||
if (clr.Ok())
|
if (clr.Ok())
|
||||||
return clr;
|
return clr;
|
||||||
|
|
||||||
@@ -1063,9 +1061,7 @@ wxColour wxXmlResourceHandler::GetColour(const wxString& param)
|
|||||||
return wxNullColour;
|
return wxNullColour;
|
||||||
}
|
}
|
||||||
|
|
||||||
return wxColour((unsigned char) ((tmp & 0xFF0000) >> 16) ,
|
return clr;
|
||||||
(unsigned char) ((tmp & 0x00FF00) >> 8),
|
|
||||||
(unsigned char) ((tmp & 0x0000FF)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user