Refactoring in ColourPicker::get_value()

This commit is contained in:
enricoturri1966 2022-01-14 11:05:05 +01:00
parent ece2c34e58
commit 35f15739d1

View File

@ -1387,10 +1387,7 @@ void ColourPicker::set_value(const boost::any& value, bool change_event)
boost::any& ColourPicker::get_value() boost::any& ColourPicker::get_value()
{ {
auto colour = static_cast<wxColourPickerCtrl*>(window)->GetColour(); auto colour = static_cast<wxColourPickerCtrl*>(window)->GetColour();
if (colour == wxTransparentColour) m_value = (colour == wxTransparentColour) ? std::string("") : encode_color(ColorRGB(colour.Red(), colour.Green(), colour.Blue()));
m_value = std::string("");
else
m_value = encode_color(ColorRGB(colour.Red(), colour.Green(), colour.Blue()));
return m_value; return m_value;
} }