From 281ad86d8d656a3a82d50cd8cec5064834d2687c Mon Sep 17 00:00:00 2001 From: Paul Cornett Date: Mon, 4 Dec 2017 09:18:10 -0800 Subject: [PATCH] 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 --- src/common/textentrycmn.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/common/textentrycmn.cpp b/src/common/textentrycmn.cpp index e81cfd95a7..1979b8ca61 100644 --- a/src/common/textentrycmn.cpp +++ b/src/common/textentrycmn.cpp @@ -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); }