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 2009/02/04 11:43:59 UTC

DO NOT REPLY [Bug 46663] New: Calling shiftRows on a xlsx file corrupts the workbook

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

           Summary: Calling shiftRows on a xlsx file corrupts the workbook
           Product: POI
           Version: 3.5-dev
          Platform: PC
        OS/Version: Windows Server 2003
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XSSF
        AssignedTo: dev@poi.apache.org
        ReportedBy: vinu.kumar@gmail.com


Created an attachment (id=23226)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=23226)
Repro file for the issue

Read an xlsx file and call shiftRows. Write the resultant workbook to a file
and open in MS office 2007.

Office throws the following error "Excel found unreadable content." and asks
for recovering. Following recovery message is thrown:

Removed Records: Cell information from /xl/worksheets/sheet1.xml part

The row gets shifted but it shifts the first column and last column is lost.


-- 
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 46663] Calling shiftRows on a xlsx file corrupts the workbook

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


Vinu Kumar <vi...@gmail.com> changed:

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




--- Comment #3 from Vinu Kumar <vi...@gmail.com>  2009-02-12 20:10:01 PST ---
This is fixed in the latest trunk


-- 
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 46663] Calling shiftRows on a xlsx file corrupts the workbook

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





--- Comment #2 from Vinu Kumar <vi...@gmail.com>  2009-02-04 22:06:20 PST ---
fixed by modifying the following code is in XSSFCell.java

 protected void modifyCellReference(XSSFRow row) {
        this.cell.setR(new CellReference(row.getRowNum(),
cellNum).formatAsString());

        CTCell[] ctCells = row.getCTRow().getCArray();
        for (CTCell ctCell : ctCells) {
            ctCell.setR(new CellReference(row.getRowNum(),
cellNum).formatAsString());
        }
    }

with this:


protected void modifyCellReference(XSSFRow row) {

       int cnum = 0;
        this.cell.setR(new CellReference(row.getRowNum(),
cnum).formatAsString());

        CTCell[] ctCells = row.getCTRow().getCArray();
        for (CTCell ctCell : ctCells) {
            ctCell.setR(new CellReference(row.getRowNum(),
cnum++).formatAsString());
        }
    }


-- 
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 46663] Calling shiftRows on a xlsx file corrupts the workbook

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





--- Comment #1 from Vinu Kumar <vi...@gmail.com>  2009-02-04 02:44:29 PST ---
Created an attachment (id=23227)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=23227)
xlsx file used for testing


-- 
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