From 2aec849b78aaab35e4c160fa6771508c122326c7 Mon Sep 17 00:00:00 2001 From: Carlos Alberto Cortez Date: Tue, 9 Dec 2008 19:50:34 +0000 Subject: [PATCH] 2008-12-09 Carlos Alberto Cortez * RichTextBox.cs: When saving the contents as a plain text, don't add a new line for every Line structure, since the data in Document already contains the new line characters. This avoids duplicated new lines using the Save methods. Fixes #445618. svn path=/trunk/mcs/; revision=121147 --- .../Managed.Windows.Forms/System.Windows.Forms/ChangeLog | 8 ++++++++ .../System.Windows.Forms/RichTextBox.cs | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog index db3839da913..49b380c97ed 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog @@ -1,3 +1,11 @@ +2008-12-09 Carlos Alberto Cortez + + * RichTextBox.cs: When saving the contents as a plain text, don't add + a new line for every Line structure, since the data in Document + already contains the new line characters. This avoids duplicated new + lines using the Save methods. + Fixes #445618. + 2008-12-09 Sandy Armstrong * TreeView.cs: Expose ScrollBars as internal properties, for use by UIA diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/RichTextBox.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/RichTextBox.cs index f8327a0ed13..a64d5609bdf 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/RichTextBox.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/RichTextBox.cs @@ -1082,7 +1082,7 @@ namespace System.Windows.Forms { } for (i = 1; i < document.Lines; i++) { - bytes = encoding.GetBytes(document.GetLine(i).text.ToString() + Environment.NewLine); + bytes = encoding.GetBytes(document.GetLine(i).text.ToString()); data.Write(bytes, 0, bytes.Length); } bytes = encoding.GetBytes(document.GetLine(document.Lines).text.ToString()); -- 2.25.1