Another small fix. DefaultStyledDocument.ElementBuffer is working a
whole lot better now. There is two cases that still need to be fixed. I
hope to be done this by the weekend!!!



2006-02-02  Lillian Angel  <[EMAIL PROTECTED]>

        * javax/swing/text/DefaultStyledDocument.java
        (insertUpdate): JoinNextDirection should push the
        'next' paragraph on the stack.

Index: javax/swing/text/DefaultStyledDocument.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/text/DefaultStyledDocument.java,v
retrieving revision 1.56
diff -u -r1.56 DefaultStyledDocument.java
--- javax/swing/text/DefaultStyledDocument.java	2 Feb 2006 18:51:36 -0000	1.56
+++ javax/swing/text/DefaultStyledDocument.java	2 Feb 2006 19:28:11 -0000
@@ -727,7 +727,6 @@
           createFracture(data);
           i = 0;
         }
-
       // Handle each ElementSpec individually.
       for (; i < data.length; i++)
         {
@@ -753,7 +752,7 @@
                 case ElementSpec.JoinNextDirection:
                   // Push the next paragraph element onto the stack so
                   // future insertions are added to it.
-                  int ix = paragraph.getElementIndex(offset);
+                  int ix = paragraph.getElementIndex(pos) + 1;
                   elementStack.push(paragraph.getElement(ix));
                   break;
                 default:
@@ -766,11 +765,11 @@
                       br = (BranchElement) createBranchElement(paragraph,
                                                                data[i].getAttributes());
                       e.added.add(br);
+                      elementStack.push(br);
                     }
                   else
                     // need to add leaves to paragraph now
                     br = insertParagraph(paragraph, pos);
-                  elementStack.push(br);
                   break;
                 }
               break;

Reply via email to