Bug 51643 - XWPFTable.createRow() uses first row as a template
Summary: XWPFTable.createRow() uses first row as a template
Status: NEW
Alias: None
Product: POI
Classification: Unclassified
Component: XWPF (show other bugs)
Version: 3.8-dev
Hardware: All All
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
Depends on:
Reported: 2011-08-10 09:11 UTC by Dmitry Kochelaev
Modified: 2011-08-10 09:11 UTC (History)
0 users


Note You need to log in before you can comment on or make changes to this bug.
Description Dmitry Kochelaev 2011-08-10 09:11:47 UTC
Currently createRow method of XWPFTableRow uses first row as template (number of columns). This looks to be a bit confusing when adding a new row in table, since it is not like previous one.

I suggest to apply following modification to XWPFTables class -- columns' number is taken from last row and not from the first one.

    public XWPFTableRow createRow() {
        int sizeCol = ctTbl.sizeOfTrArray() > 0 ? ctTbl.getTrArray(ctTbl.sizeOfTrArray() - 1).sizeOfTcArray() : 0;