bug-classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug swing/24149] New: PlainDocument not properly collapsing lines after


From: abalkiss at redhat dot com
Subject: [Bug swing/24149] New: PlainDocument not properly collapsing lines after a remove
Date: 30 Sep 2005 16:55:48 -0000

Remove operations that span line boundaries are supposed to collapse the
surrounding Elements.  This testcase shows it's not working properly.

***TESTCASE OUTPUT***
Expected output: 
<paragraph>
  <content>
    [0,11][Line Three
]
root children: 1

Actual output:
<paragraph>
  <content>
    [0,6][Line T]
  <content>
    [6,11][hree
]
root children: 2


***TESTCASE CODE***
import javax.swing.text.*;

public class PlainDocExample {
  public static void main(String[] args) {
    try {

      // Dump an empty document
      PlainDocument doc = new PlainDocument();
      AbstractDocument.AbstractElement root = (AbstractDocument.AbstractElement)
doc.getDefaultRootElement();
      doc.insertString(0, "Line One\n", null);
      doc.insertString(doc.getLength(), "Line Two\n", null);
      doc.insertString(doc.getLength(), "Line Three", null);
      doc.remove(5, 18);
      root.dump(System.out, 0);
      System.out.println ("root children: "+root.getElementCount());
    } catch (BadLocationException ex) {}
  }
}

-- 
           Summary: PlainDocument not properly collapsing lines after a
                    remove
           Product: classpath
           Version: unspecified
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: swing
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: abalkiss at redhat dot com
                CC: bug-classpath at gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24149




reply via email to

[Prev in Thread] Current Thread [Next in Thread]