You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2011/09/08 15:40:25 UTC

DO NOT REPLY [Bug 51787] New: First row is duplicated in the XWPFTable constructor

https://issues.apache.org/bugzilla/show_bug.cgi?id=51787

             Bug #: 51787
           Summary: First row is duplicated in the XWPFTable constructor
           Product: POI
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: major
          Priority: P2
         Component: XWPF
        AssignedTo: dev@poi.apache.org
        ReportedBy: c_igaly@yahoo.co.uk
    Classification: Unclassified


In the case when row (or rows) is already present in tableRows, the folowing
code in the constructor will anyway add it for the second time:

XWPFTableRow tabRow = (getRow(i) == null) ? createRow() : getRow(i);
tableRows.add(tabRow);

I've fixed that problem by replacing the code above with:

XWPFTableRow tabRow = getRow(i);
if (tabRow == null) {
    tabRow = createRow();
    tableRows.add(tabRow);
}

and it is working for me. However, I can not guarantee that I did not misssed
something important.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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


DO NOT REPLY [Bug 51787] First row is duplicated in the XWPFTable constructor

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=51787

Nick Burch <ni...@alfresco.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |NEEDINFO

--- Comment #1 from Nick Burch <ni...@alfresco.com> 2011-09-09 15:13:31 UTC ---
Any chance you could write a short junit unit test to go with this? We can then
use it to verify the fix, and ensure it doesn't get broken again in future

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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