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/trunk@49429 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2007-10-25 14:41:21 +00:00
parent e0e742c32e
commit caad01090a

View File

@@ -4813,7 +4813,8 @@ wxTextAttr wxRichTextBuffer::GetStyleForNewParagraph(long pos, bool caretPositio
wxRichTextParagraphStyleDefinition* paraDef = GetStyleSheet()->FindParagraphStyle(para->GetAttributes().GetParagraphStyleName()); wxRichTextParagraphStyleDefinition* paraDef = GetStyleSheet()->FindParagraphStyle(para->GetAttributes().GetParagraphStyleName());
if (paraDef) 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()); wxRichTextParagraphStyleDefinition* nextParaDef = GetStyleSheet()->FindParagraphStyle(paraDef->GetNextStyle());
if (nextParaDef) if (nextParaDef)