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 2015/04/06 15:27:32 UTC

[Bug 57163] Cannot delete an arbitrary sheet in an XLS workbook (only the last one)

https://bz.apache.org/bugzilla/show_bug.cgi?id=57163

Vladimir <vl...@gmail.com> changed:

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

--- Comment #7 from Vladimir <vl...@gmail.com> ---
This bug is still occurs for XLS (HSSFWorkbook) in release POI 3.12 beta 1.
Problem in org.apache.poi.hssf.model.InternalWorkbook:780

public void removeSheet(int sheetIndex) {
    ....

    // also tell the LinkTable about the removed sheet
    // +1 because we already removed it from the count of sheets!
    for(int i = sheetIndex+1;i < getNumSheets()+1;i++) {
        // also update the link-table as otherwise references might point at
invalid sheets
        linkTable.removeSheet(i);
    }
}

It is allowed linkTable field to be null!!!

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