Correction to style code
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43725 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -722,15 +722,20 @@ wxString wxRichTextStyleListBox::GetStyleToShowInIdleTime(wxRichTextCtrl* ctrl,
|
|||||||
// Take into account current default style just chosen by user
|
// Take into account current default style just chosen by user
|
||||||
if (ctrl->IsDefaultStyleShowing())
|
if (ctrl->IsDefaultStyleShowing())
|
||||||
{
|
{
|
||||||
|
wxTextAttrEx attr;
|
||||||
|
|
||||||
|
ctrl->GetStyle(adjustedCaretPos, attr);
|
||||||
|
wxRichTextApplyStyle(attr, ctrl->GetDefaultStyleEx());
|
||||||
|
|
||||||
if ((styleType == wxRICHTEXT_STYLE_ALL || styleType == wxRICHTEXT_STYLE_CHARACTER) &&
|
if ((styleType == wxRICHTEXT_STYLE_ALL || styleType == wxRICHTEXT_STYLE_CHARACTER) &&
|
||||||
!ctrl->GetDefaultStyleEx().GetCharacterStyleName().IsEmpty())
|
!attr.GetCharacterStyleName().IsEmpty())
|
||||||
styleName = ctrl->GetDefaultStyleEx().GetCharacterStyleName();
|
styleName = attr.GetCharacterStyleName();
|
||||||
else if ((styleType == wxRICHTEXT_STYLE_ALL || styleType == wxRICHTEXT_STYLE_PARAGRAPH) &&
|
else if ((styleType == wxRICHTEXT_STYLE_ALL || styleType == wxRICHTEXT_STYLE_PARAGRAPH) &&
|
||||||
!ctrl->GetDefaultStyleEx().GetParagraphStyleName().IsEmpty())
|
!attr.GetParagraphStyleName().IsEmpty())
|
||||||
styleName = ctrl->GetDefaultStyleEx().GetParagraphStyleName();
|
styleName = attr.GetParagraphStyleName();
|
||||||
else if ((styleType == wxRICHTEXT_STYLE_ALL || styleType == wxRICHTEXT_STYLE_LIST) &&
|
else if ((styleType == wxRICHTEXT_STYLE_ALL || styleType == wxRICHTEXT_STYLE_LIST) &&
|
||||||
!ctrl->GetDefaultStyleEx().GetListStyleName().IsEmpty())
|
!attr.GetListStyleName().IsEmpty())
|
||||||
styleName = ctrl->GetDefaultStyleEx().GetListStyleName();
|
styleName = attr.GetListStyleName();
|
||||||
}
|
}
|
||||||
else if (obj && (styleType == wxRICHTEXT_STYLE_ALL || styleType == wxRICHTEXT_STYLE_CHARACTER) &&
|
else if (obj && (styleType == wxRICHTEXT_STYLE_ALL || styleType == wxRICHTEXT_STYLE_CHARACTER) &&
|
||||||
!obj->GetAttributes().GetCharacterStyleName().IsEmpty())
|
!obj->GetAttributes().GetCharacterStyleName().IsEmpty())
|
||||||
|
Reference in New Issue
Block a user