don't use m_stylePopup inside GetRichTextCtrl() before testing whether it's NULL
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45155 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1088,9 +1088,19 @@ bool wxRichTextStyleComboCtrl::Create(wxWindow* parent, wxWindowID id, const wxP
|
|||||||
|
|
||||||
void wxRichTextStyleComboCtrl::OnIdle(wxIdleEvent& event)
|
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();
|
wxString currentValue = GetValue();
|
||||||
if (!styleName.IsEmpty())
|
if (!styleName.IsEmpty())
|
||||||
@@ -1104,7 +1114,6 @@ void wxRichTextStyleComboCtrl::OnIdle(wxIdleEvent& event)
|
|||||||
else if (!currentValue.IsEmpty())
|
else if (!currentValue.IsEmpty())
|
||||||
SetValue(wxEmptyString);
|
SetValue(wxEmptyString);
|
||||||
}
|
}
|
||||||
event.Skip();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user