From 1f57c2895ed6a16782df3d30274ba8a2d6cd17b3 Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Thu, 25 Oct 2007 14:41:05 +0000 Subject: [PATCH] Fixed a style application bug inserting a newline other than after the end of a paragraph. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@49428 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/richtext/richtextbuffer.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/richtext/richtextbuffer.cpp b/src/richtext/richtextbuffer.cpp index 2d1494b31c..17686aae19 100644 --- a/src/richtext/richtextbuffer.cpp +++ b/src/richtext/richtextbuffer.cpp @@ -4880,7 +4880,8 @@ wxRichTextAttr wxRichTextBuffer::GetStyleForNewParagraph(long pos, bool caretPos wxRichTextParagraphStyleDefinition* paraDef = GetStyleSheet()->FindParagraphStyle(para->GetAttributes().GetParagraphStyleName()); if (paraDef) { - if (!paraDef->GetNextStyle().IsEmpty()) + // If we're not at the end of the paragraph, then we apply THIS style, and not the designated next style. + if (para->GetRange().GetEnd() == pos && !paraDef->GetNextStyle().IsEmpty()) { wxRichTextParagraphStyleDefinition* nextParaDef = GetStyleSheet()->FindParagraphStyle(paraDef->GetNextStyle()); if (nextParaDef)