poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 50833] New: workbook.write(outputstream) corrupts cell comments for protected workbooks
Date Fri, 25 Feb 2011 23:49:25 GMT

           Summary: workbook.write(outputstream) corrupts cell comments
                    for protected workbooks
           Product: POI
           Version: 3.7
          Platform: PC
            Status: NEW
          Severity: major
          Priority: P2
         Component: HSSF
        AssignedTo: dev@poi.apache.org
        ReportedBy: robertl@jlab.org

Created an attachment (id=26695)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=26695)
sample xls workbook to use with code provided in description

If you have a workbook that is protected and you open the it and write it to an
output stream, all comments in the workbook end up corrupted.
Attached is a sample workbook (protected password is "password") to use with
the following code:

import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;

public class CommentTest {
    public static void main(String[] args) throws Exception {
        File file = new File("Book1.xls");
        FileInputStream fileInputStream = new FileInputStream(file);
        HSSFWorkbook workbook = new HSSFWorkbook(fileInputStream);
        workbook.write(new FileOutputStream(new File("Book1_copy.xls")));

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

View raw message