Fixed bug [ 1714813 ] ApplyXXXToSelection remove style
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@52115 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -2937,7 +2937,11 @@ bool wxRichTextCtrl::ApplyBoldToSelection()
|
||||
if (HasSelection())
|
||||
return SetStyleEx(GetSelectionRange(), attr, wxRICHTEXT_SETSTYLE_WITH_UNDO|wxRICHTEXT_SETSTYLE_OPTIMIZE|wxRICHTEXT_SETSTYLE_CHARACTERS_ONLY);
|
||||
else
|
||||
SetAndShowDefaultStyle(attr);
|
||||
{
|
||||
wxRichTextAttr current = GetDefaultStyleEx();
|
||||
current.Apply(attr);
|
||||
SetAndShowDefaultStyle(current);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -2951,7 +2955,11 @@ bool wxRichTextCtrl::ApplyItalicToSelection()
|
||||
if (HasSelection())
|
||||
return SetStyleEx(GetSelectionRange(), attr, wxRICHTEXT_SETSTYLE_WITH_UNDO|wxRICHTEXT_SETSTYLE_OPTIMIZE|wxRICHTEXT_SETSTYLE_CHARACTERS_ONLY);
|
||||
else
|
||||
SetAndShowDefaultStyle(attr);
|
||||
{
|
||||
wxRichTextAttr current = GetDefaultStyleEx();
|
||||
current.Apply(attr);
|
||||
SetAndShowDefaultStyle(current);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -2965,7 +2973,11 @@ bool wxRichTextCtrl::ApplyUnderlineToSelection()
|
||||
if (HasSelection())
|
||||
return SetStyleEx(GetSelectionRange(), attr, wxRICHTEXT_SETSTYLE_WITH_UNDO|wxRICHTEXT_SETSTYLE_OPTIMIZE|wxRICHTEXT_SETSTYLE_CHARACTERS_ONLY);
|
||||
else
|
||||
SetAndShowDefaultStyle(attr);
|
||||
{
|
||||
wxRichTextAttr current = GetDefaultStyleEx();
|
||||
current.Apply(attr);
|
||||
SetAndShowDefaultStyle(current);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -3043,7 +3055,9 @@ bool wxRichTextCtrl::ApplyStyle(wxRichTextStyleDefinition* def)
|
||||
return SetStyleEx(GetSelectionRange(), attr, flags);
|
||||
else
|
||||
{
|
||||
SetAndShowDefaultStyle(attr);
|
||||
wxRichTextAttr current = GetDefaultStyleEx();
|
||||
current.Apply(attr);
|
||||
SetAndShowDefaultStyle(current);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user