Fixed bug [ 1714813 ] ApplyXXXToSelection remove style

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@52116 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart 2008-02-26 14:55:42 +00:00
parent 11f0898b7d
commit 063dbace7b

View File

@ -2880,7 +2880,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;
}
@ -2894,7 +2898,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;
}
@ -2908,7 +2916,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;
}
@ -2986,7 +2998,9 @@ bool wxRichTextCtrl::ApplyStyle(wxRichTextStyleDefinition* def)
return SetStyleEx(GetSelectionRange(), attr, flags);
else
{
SetAndShowDefaultStyle(attr);
wxRichTextAttr current = GetDefaultStyleEx();
current.Apply(attr);
SetAndShowDefaultStyle(current);
return true;
}
}