Avoid permanently setting text hint color when using generic text entry hints

Multiple calls to SetHint() would cause the original color to be lost
See #17118
This commit is contained in:
Paul Cornett 2017-12-04 09:18:10 -08:00
parent 26f48c225e
commit 281ad86d8d

View File

@ -102,8 +102,11 @@ private:
// Save the old text colour and set a more inconspicuous one for the
// hint.
m_colFg = m_win->GetForegroundColour();
m_win->SetForegroundColour(*wxLIGHT_GREY);
if (!m_colFg.IsOk())
{
m_colFg = m_win->GetForegroundColour();
m_win->SetForegroundColour(*wxLIGHT_GREY);
}
m_entry->DoSetValue(m_hint, wxTextEntryBase::SetValue_NoEvent);
}