+
+ // If it's a paragraph style, we want to apply the style to the
+ // current paragraph even if we didn't select any text.
+ if (isPara)
+ {
+ long pos = GetAdjustedCaretPosition(GetCaretPosition());
+ wxRichTextParagraph* para = GetBuffer().GetParagraphAtPosition(pos);
+ if (para)
+ {
+ return SetStyleEx(para->GetRange().FromInternal(), attr, flags);
+ }
+ }