X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/906c935a80b10d53cecf57f71ab5f3f4f1d529ec..77c8efc8c37da6d6a5e2e8022d21d1cd7d76371d:/src/common/clrpickercmn.cpp diff --git a/src/common/clrpickercmn.cpp b/src/common/clrpickercmn.cpp index 510488dd11..9420551b5a 100644 --- a/src/common/clrpickercmn.cpp +++ b/src/common/clrpickercmn.cpp @@ -96,13 +96,6 @@ void wxColourPickerCtrl::UpdatePickerFromTextCtrl() { wxASSERT(m_text); - if (m_bIgnoreNextTextCtrlUpdate) - { - // ignore this update - m_bIgnoreNextTextCtrlUpdate = false; - return; - } - // wxString -> wxColour conversion wxColour col(m_text->GetValue()); if ( !col.IsOk() ) @@ -123,11 +116,9 @@ void wxColourPickerCtrl::UpdateTextCtrlFromPicker() if (!m_text) return; // no textctrl to update - // NOTE: this SetValue() will generate an unwanted wxEVT_COMMAND_TEXT_UPDATED - // which will trigger a unneeded UpdateFromTextCtrl(); thus before using - // SetValue() we set the m_bIgnoreNextTextCtrlUpdate flag... - m_bIgnoreNextTextCtrlUpdate = true; - m_text->SetValue(M_PICKER->GetColour().GetAsString()); + // Take care to use ChangeValue() here and not SetValue() to avoid + // infinite recursion. + m_text->ChangeValue(M_PICKER->GetColour().GetAsString()); }