2008-12-09 Carlos Alberto Cortez <calberto.cortez@gmail.com>
authorCarlos Alberto Cortez <calberto.cortez@gmail.com>
Tue, 9 Dec 2008 19:50:34 +0000 (19:50 -0000)
committerCarlos Alberto Cortez <calberto.cortez@gmail.com>
Tue, 9 Dec 2008 19:50:34 +0000 (19:50 -0000)
* 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

mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
mcs/class/Managed.Windows.Forms/System.Windows.Forms/RichTextBox.cs

index db3839da913c9c56618d8033037df69b1b385ff0..49b380c97ed9e8db535b1575eb06494c2fd7fe81 100644 (file)
@@ -1,3 +1,11 @@
+2008-12-09  Carlos Alberto Cortez <calberto.cortez@gmail.com>
+
+       * 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  <sanfordarmstrong@gmail.com>
 
        * TreeView.cs: Expose ScrollBars as internal properties, for use by UIA
index f8327a0ed136a4512d6e282b5e920b6ae4d9d363..a64d5609bdf8a9b81a884b0f2815fb2753f2035d 100644 (file)
@@ -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());