https://bugzilla.novell.com/show_bug.cgi?id=445618


           Summary: Save File in RichTextBox adds extra Line Feeds
           Product: Mono: Class Libraries
           Version: 2.0
          Platform: i586
        OS/Version: Ubuntu
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: Windows.Forms
        AssignedTo: [email protected]
        ReportedBy: [EMAIL PROTECTED]
         QAContact: [email protected]
          Found By: ---


When saving files using a RichTextBox extra line feeds are added.
Under Windows XP the structure is unchanged after saving. Under Ubuntu extra
line feeds are present.

Steps to recreate;
1. Add; RichTextBox - richTextBox1, Button - cmdLoad, Button - cmdSave
2. Open a file using the plain text option
3. Save the file with the plain text option
4. View the file with Vi/Vim and extra lines have been added.

private string fileName;

private void cmdLoad_Click(object sender, EventArgs e)
{
    using (OpenFileDialog ofd = new OpenFileDialog())
    {
        if (ofd.ShowDialog() == DialogResult.OK)
        {
            fileName = ofd.FileName;
            richTextBox1.LoadFile(ofd.FileName,
RichTextBoxStreamType.PlainText);
        }
        else
        {
            fileName = null;
        }
    }
}

private void cmdSave_Click(object sender, EventArgs e)
{
    if (!String.IsNullOrEmpty(fileName))
    {
        richTextBox1.SaveFile(fileName, RichTextBoxStreamType.PlainText);
    }
}


-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.
_______________________________________________
mono-bugs maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-bugs

Reply via email to