[GitHub] poi pull request #99: Bug-62055 - Fix XSSFImportFromXML table resize

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

[GitHub] poi pull request #99: Bug-62055 - Fix XSSFImportFromXML table resize

GitHub user kapep opened a pull request:


    Bug-62055 - Fix XSSFImportFromXML table resize

    Fixes [Bug-62055](https://bz.apache.org/bugzilla/show_bug.cgi?id=62055) and one other issues with the XSSFImportFromXML.
    The main change is that importing `XSSFImportFromXML.importFromXML` now resizes mapped tables when importing XML data. Each table will have the a row count of exactly the amount of imported elements, i.e. it shrinks or grows accordingly. When growing, cells below the table are overwritten.
    The other issue this fixes is that table column id's were wrongly used to get the column position. This resulted in data written to wrong columns when the id did not match the positions.
    Additional checks have been added to the tests for both issues. Changes to `CustomXMLMappings-complex-type.xlsx` include:
    - Added an additional (unmapped) column to verify that data is written to correct columns when the column id doesn't match the columns position
    - Added some text in a cell below a table that will grow, to check if the cell is correctly overwritten when the table grows
    - Added some text in a cell inside a table that will shrink, to check if the cell is correctly cleared when the shrinks

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/kapep/poi Bug62055_XSSFImportFromXML-table-resize

Alternatively you can review and apply these changes as the patch at:


To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #99
commit 3a4fce7b2bd1fedd634c35f4e084630add6a583b
Author: Leonard Kappe <kappe@...>
Date:   2018-02-06T19:24:25Z

    Bug 62055: Resize tables when importing XML map



To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]