From fc2f7de76303dbe92c3c0fd2f427ae2f429140f4 Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Wed, 2 Mar 2011 20:55:16 +0000 Subject: [PATCH] Fixed a problem with paste resetting the content paragraph style. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@67111 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- docs/changes.txt | 1 + src/richtext/richtextbuffer.cpp | 24 +----------------------- 2 files changed, 2 insertions(+), 23 deletions(-) diff --git a/docs/changes.txt b/docs/changes.txt index 7afb377dcb..2d6e6e6240 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -111,6 +111,7 @@ All (GUI): avoids duplicating character attributes in subsequently typed text when they exist in the paragraph style. - wxRTC: fixed IsPositionVisible to scroll a position into view correctly. +- wxRTC: fixed a problem with paste resetting the content paragraph style. - Fixed error in generic tree control CalculatePositions. - Added wxFD_FILE_MUST_EXIST to wxFileSelector function. - Added wxDataViewCtrl Get/SetValueByRow functions for forward compatibility diff --git a/src/richtext/richtextbuffer.cpp b/src/richtext/richtextbuffer.cpp index 047bffe1d4..3f62081672 100644 --- a/src/richtext/richtextbuffer.cpp +++ b/src/richtext/richtextbuffer.cpp @@ -5823,34 +5823,12 @@ wxRichTextStyleSheet* wxRichTextBuffer::PopStyleSheet() } /// Submit command to insert paragraphs -bool wxRichTextBuffer::InsertParagraphsWithUndo(long pos, const wxRichTextParagraphLayoutBox& paragraphs, wxRichTextCtrl* ctrl, int flags) +bool wxRichTextBuffer::InsertParagraphsWithUndo(long pos, const wxRichTextParagraphLayoutBox& paragraphs, wxRichTextCtrl* ctrl, int WXUNUSED(flags)) { wxRichTextAction* action = new wxRichTextAction(NULL, _("Insert Text"), wxRICHTEXT_INSERT, this, ctrl, false); - wxTextAttrEx attr(GetDefaultStyle()); - - wxTextAttrEx* p = NULL; - wxTextAttrEx paraAttr; - if (flags & wxRICHTEXT_INSERT_WITH_PREVIOUS_PARAGRAPH_STYLE) - { - paraAttr = GetStyleForNewParagraph(pos); - if (!paraAttr.IsDefault()) - p = & paraAttr; - } - else - p = & attr; - action->GetNewParagraphs() = paragraphs; - if (p && !p->IsDefault()) - { - for (wxRichTextObjectList::compatibility_iterator node = action->GetNewParagraphs().GetChildren().GetFirst(); node; node = node->GetNext()) - { - wxRichTextObject* child = node->GetData(); - child->SetAttributes(*p); - } - } - action->SetPosition(pos); wxRichTextRange range = wxRichTextRange(pos, pos + paragraphs.GetRange().GetEnd() - 1);