[Bug 65023] New: addNewCol is untested and does not work

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[Bug 65023] New: addNewCol is untested and does not work

Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=65023

            Bug ID: 65023
           Summary: addNewCol is untested and does not work
           Product: POI
           Version: unspecified
          Hardware: PC
                OS: Mac OS X 10.1
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XWPF
          Assignee: [hidden email]
          Reporter: [hidden email]
  Target Milestone: ---

In src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFTable.java, the method
addNewCol() is unused and also untested in the Apache POI project. In the
course of writing a unit test for it, I discovered that the implementation does
not work as it creates new rows instead of using the existing ones.

I am writing a fix for it and will submit a PR via GitHub. I will add a comment
to this report once I have done so - I need to submit this report first in
order to get an issue number.

Test to reproduce the issue:

    @Test
    public void testAddNewCol() throws IOException {
        XWPFDocument doc = new XWPFDocument();
        XWPFTable table = doc.createTable(2, 4);
        table.addNewCol();
        XWPFTableRow lastRow = table.tableRows.get(table.tableRows.size() - 1);

        int expected = 5;
        int actual = lastRow.getTableCells().size();
        assertEquals(expected, actual);
        doc.close();
    }

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 65023] addNewCol is untested and does not work

Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=65023

--- Comment #1 from Paula Muldoon <[hidden email]> ---
Pull request on GitHub: https://github.com/apache/poi/pull/212

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 65023] addNewCol is untested and does not work

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=65023

--- Comment #2 from shubhu shubhu <[hidden email]> ---
(In reply to Paula Muldoon from comment #1)
> Pull request on GitHub: https://github.com/apache/poi/pull/212

https://technicaldude.tech/

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 65023] addNewCol is untested and does not work

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=65023

PJ Fanning <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED

--- Comment #2 from PJ Fanning <[hidden email]> ---
Merged Github PR using r1884794

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]