poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n...@apache.org
Subject svn commit: r1098923 - in /poi/trunk/src: documentation/content/xdocs/status.xml ooxml/java/org/apache/poi/xwpf/usermodel/XWPFParagraph.java ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFParagraph.java
Date Tue, 03 May 2011 05:53:24 GMT
Author: nick
Date: Tue May  3 05:53:24 2011
New Revision: 1098923

URL: http://svn.apache.org/viewvc?rev=1098923&view=rev
Log:
Fix bug #51113 - Correct XWPFParagraph tracking of inserted runs

Modified:
    poi/trunk/src/documentation/content/xdocs/status.xml
    poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFParagraph.java
    poi/trunk/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFParagraph.java

Modified: poi/trunk/src/documentation/content/xdocs/status.xml
URL: http://svn.apache.org/viewvc/poi/trunk/src/documentation/content/xdocs/status.xml?rev=1098923&r1=1098922&r2=1098923&view=diff
==============================================================================
--- poi/trunk/src/documentation/content/xdocs/status.xml (original)
+++ poi/trunk/src/documentation/content/xdocs/status.xml Tue May  3 05:53:24 2011
@@ -34,6 +34,7 @@
 
     <changes>
         <release version="3.8-beta3" date="2011-??-??">
+           <action dev="poi-developers" type="fix">51113 - Correct XWPFParagraph tracking
of inserted runs</action>
            <action dev="poi-developers" type="fix">51111 - Correct XWPFParagraph tracking
of new runs</action>
            <action dev="poi-developers" type="fix">51115 - Handle DataFormatter escaping
of "." in the same way as "-" and "/"</action>
            <action dev="poi-developers" type="fix">51100 - Fix IOUtils issue for NPOIFS
reading from an InputStream where every block is full</action>

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFParagraph.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFParagraph.java?rev=1098923&r1=1098922&r2=1098923&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFParagraph.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFParagraph.java Tue May  3 05:53:24
2011
@@ -1178,7 +1178,7 @@ public class XWPFParagraph implements IB
     	 if (pos >= 0 && pos <= paragraph.sizeOfRArray()) {
 	    	CTR ctRun = paragraph.insertNewR(pos);
 	    	XWPFRun newRun = new XWPFRun(ctRun, this);
-	    	runs.add(newRun);
+	    	runs.add(pos, newRun);
 	    	return newRun;
     	 }
     	 return null;

Modified: poi/trunk/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFParagraph.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFParagraph.java?rev=1098923&r1=1098922&r2=1098923&view=diff
==============================================================================
--- poi/trunk/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFParagraph.java (original)
+++ poi/trunk/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFParagraph.java Tue
May  3 05:53:24 2011
@@ -260,6 +260,12 @@ public final class TestXWPFParagraph ext
        
        XWPFRun r = p.createRun();
        assertEquals(3, p.getRuns().size());
+       assertEquals(2, p.getRuns().indexOf(r));
+       
+       XWPFRun r2 = p.insertNewRun(1);
+       assertEquals(4, p.getRuns().size());
+       assertEquals(1, p.getRuns().indexOf(r2));
+       assertEquals(3, p.getRuns().indexOf(r));
     }
     
     public void testPictures() throws Exception {



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org


Mime
View raw message