Fixed default style setting to take into account text boxes; fixed AddBoxStyle
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70299 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -4086,7 +4086,15 @@ bool wxRichTextCtrl::SetDefaultStyleToCursorStyle()
|
||||
// If at the start of a paragraph, use the next position.
|
||||
long pos = GetAdjustedCaretPosition(GetCaretPosition());
|
||||
|
||||
if (GetUncombinedStyle(pos, attr))
|
||||
wxRichTextObject* obj = GetFocusObject()->GetLeafObjectAtPosition(pos);
|
||||
if (obj && obj->IsTopLevel())
|
||||
{
|
||||
// Don't use the attributes of a top-level object, since they might apply
|
||||
// to content of the object, e.g. background colour.
|
||||
SetDefaultStyle(wxRichTextAttr());
|
||||
return true;
|
||||
}
|
||||
else if (GetUncombinedStyle(pos, attr))
|
||||
{
|
||||
SetDefaultStyle(attr);
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user