A small fix
2006-01-31 Lillian Angel <[EMAIL PROTECTED]>
* javax/swing/text/DefaultStyledDocument.java
(insert): Removed comment.
(insertUpdate): Added comment.
(recreateLeaves): Removed call to push newBranch onto the
stack. This does not need to be done here.
Index: javax/swing/text/DefaultStyledDocument.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/text/DefaultStyledDocument.java,v
retrieving revision 1.51
diff -u -r1.51 DefaultStyledDocument.java
--- javax/swing/text/DefaultStyledDocument.java 30 Jan 2006 21:26:25 -0000 1.51
+++ javax/swing/text/DefaultStyledDocument.java 31 Jan 2006 16:37:28 -0000
@@ -666,17 +667,19 @@
{
if (length == 0)
return;
+
this.offset = offset;
this.pos = offset;
this.endOffset = offset + length;
this.length = length;
documentEvent = ev;
- // Push the root and the paragraph at offset onto the element stack.
+
edits.removeAllElements();
elementStack.removeAllElements();
lastFractured = null;
origParCreated = false;
fracNotCreated = false;
+
insertUpdate(data);
// This for loop applies all the changes that were made and updates the
@@ -702,6 +705,7 @@
*/
protected void insertUpdate(ElementSpec[] data)
{
+ // Push the root and the paragraph at offset onto the element stack.
origParCreated = false;
Element current = root;
int index;
@@ -1049,7 +1053,6 @@
Element[] added = recreateAfterFracture(removed, newBranch, 0, child.getEndOffset());
edit = getEditForParagraphAndIndex(newBranch, 1);
edit.addAddedElements(added);
- elementStack.push(newBranch);
lastFractured = newLeaf;
offset = newBranch.getEndOffset();
}