]> source.dussan.org Git - poi.git/commitdiff
Fix bug #51112 - Correct XWPFTable tracking of new rows
authorNick Burch <nick@apache.org>
Tue, 3 May 2011 05:56:22 +0000 (05:56 +0000)
committerNick Burch <nick@apache.org>
Tue, 3 May 2011 05:56:22 +0000 (05:56 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1098927 13f79535-47bb-0310-9956-ffa450edef68

src/documentation/content/xdocs/status.xml
src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFTable.java
src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFTable.java

index ceff12e6ab2561c33237686d446478d2989a9c7b..7b1b3bbfd45f21a8f4f7e9cdfc2873f95b134188 100644 (file)
@@ -34,6 +34,7 @@
 
     <changes>
         <release version="3.8-beta3" date="2011-??-??">
+           <action dev="poi-developers" type="fix">51112 - Correct XWPFTable tracking of new rows</action>
            <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>
index 926260e26a4f128bb5ca5a78617864bcf4d545fe..ec981cad36179de4741615aaa219124f9f54f4b1 100644 (file)
@@ -159,6 +159,7 @@ public class XWPFTable implements IBodyElement{
                 .sizeOfTcArray() : 0;
         XWPFTableRow tabRow = new XWPFTableRow(ctTbl.addNewTr(), this);
         addColumn(tabRow, sizeCol);
+        tableRows.add(tabRow);
         return tabRow;
     }
 
index 91f43f4dffc64efd976a14abb0c692a319e546d2..6d9a0e93b31526e5c064801efc5dd14e8a6dac96 100644 (file)
@@ -94,6 +94,7 @@ public class TestXWPFTable extends TestCase {
 
         //add a new row
         xtab.createRow();
+        assertEquals(4, xtab.getNumberOfRows());
 
         //check number of cols
         assertEquals(2, table.getTrArray(0).sizeOfTcArray());