X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/cd5dea50f87cfdcf2377ff4b73b19a1a9732cf24..950905affdfa9041316f82308e1a11e82c783070:/src/richtext/richtextstyles.cpp diff --git a/src/richtext/richtextstyles.cpp b/src/richtext/richtextstyles.cpp index 38e5553150..0b8782c756 100644 --- a/src/richtext/richtextstyles.cpp +++ b/src/richtext/richtextstyles.cpp @@ -1088,9 +1088,19 @@ bool wxRichTextStyleComboCtrl::Create(wxWindow* parent, wxWindowID id, const wxP void wxRichTextStyleComboCtrl::OnIdle(wxIdleEvent& event) { - if (GetRichTextCtrl() && !IsPopupShown() && m_stylePopup && wxWindow::FindFocus() != this) + event.Skip(); + + if ( !m_stylePopup ) + return; + + wxRichTextCtrl * const richtext = GetRichTextCtrl(); + if ( !richtext ) + return; + + if ( !IsPopupShown() && wxWindow::FindFocus() != this ) { - wxString styleName = wxRichTextStyleListBox::GetStyleToShowInIdleTime(GetRichTextCtrl(), m_stylePopup->GetStyleType()); + wxString styleName = + wxRichTextStyleListBox::GetStyleToShowInIdleTime(richtext, m_stylePopup->GetStyleType()); wxString currentValue = GetValue(); if (!styleName.IsEmpty()) @@ -1104,7 +1114,6 @@ void wxRichTextStyleComboCtrl::OnIdle(wxIdleEvent& event) else if (!currentValue.IsEmpty()) SetValue(wxEmptyString); } - event.Skip(); } #endif