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:
Vadim Zeitlin
2007-03-30 16:05:25 +00:00
parent af4bfc044f
commit ecb7235d76

View File

@@ -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