Modified:
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/RichTextBox.cs
Log:
* RichTextBox.cs: Set the line endings correctly, when flushing
RTF text.
Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog 2007-05-22 20:02:07 UTC (rev 77810)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog 2007-05-22 20:03:10 UTC (rev 77811)
@@ -1,3 +1,8 @@
+2007-05-22 Jackson Harper <jac...@ximian.com>
+
+ * RichTextBox.cs: Set the line endings correctly, when flushing
+ RTF text.
+
2007-05-22 Gert Driesen <drie...@users.sourceforge.net>
* XplatUIX11.cs: MinimumWindowSize on X11 is actually
Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/RichTextBox.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/RichTextBox.cs 2007-05-22 20:02:07 UTC (rev 77810)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/RichTextBox.cs 2007-05-22 20:03:10 UTC (rev 77811)
@@ -1545,8 +1545,11 @@
rtf_chars += rtf_line.Length;
+
+
if (rtf_cursor_x == 0) {
- document.Add(rtf_cursor_y, rtf_line.ToString(), rtf_rtfalign, font, rtf_color, LineEnding.Wrap);
+ document.Add(rtf_cursor_y, rtf_line.ToString(), rtf_rtfalign, font, rtf_color,
+ newline ? LineEnding.Rich : LineEnding.Wrap);
if (rtf_par_line_left_indent != 0) {
Line line = document.GetLine (rtf_cursor_y);
line.indent = rtf_par_line_left_indent;
@@ -1558,10 +1561,14 @@
line.indent = rtf_par_line_left_indent;
if (rtf_line.Length > 0) {
document.InsertString(line, rtf_cursor_x, rtf_line.ToString());
- document.FormatText(line, rtf_cursor_x + 1, line, rtf_cursor_x + 1 + length, font, rtf_color, null, FormatSpecified.Font | FormatSpecified.Color); // FormatText is 1-based
+ document.FormatText (line, rtf_cursor_x + 1, line, rtf_cursor_x + 1 + length,
+ font, rtf_color, null,
+ FormatSpecified.Font | FormatSpecified.Color);
}
if (newline) {
document.Split(line, rtf_cursor_x + length);
+ line = document.GetLine (rtf_cursor_y);
+ line.ending = LineEnding.Rich;
}
}