From: Nick Burch Date: Tue, 3 May 2011 05:56:22 +0000 (+0000) Subject: Fix bug #51112 - Correct XWPFTable tracking of new rows X-Git-Tag: REL_3_8_BETA3~47 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=bae166f687aae81044f5b4f81d0222d2937cb33d;p=poi.git Fix bug #51112 - Correct XWPFTable tracking of new rows git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1098927 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/documentation/content/xdocs/status.xml b/src/documentation/content/xdocs/status.xml index ceff12e6ab..7b1b3bbfd4 100644 --- a/src/documentation/content/xdocs/status.xml +++ b/src/documentation/content/xdocs/status.xml @@ -34,6 +34,7 @@ + 51112 - Correct XWPFTable tracking of new rows 51113 - Correct XWPFParagraph tracking of inserted runs 51111 - Correct XWPFParagraph tracking of new runs 51115 - Handle DataFormatter escaping of "." in the same way as "-" and "/" diff --git a/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFTable.java b/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFTable.java index 926260e26a..ec981cad36 100644 --- a/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFTable.java +++ b/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFTable.java @@ -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; } diff --git a/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFTable.java b/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFTable.java index 91f43f4dff..6d9a0e93b3 100644 --- a/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFTable.java +++ b/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFTable.java @@ -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());