Bug 45472 - Default row height problem with 3.1, OpenOffice 2.3
Summary: Default row height problem with 3.1, OpenOffice 2.3
Alias: None
Product: POI
Classification: Unclassified
Component: HSSF (show other bugs)
Version: unspecified
Hardware: PC Linux
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
Depends on:
Reported: 2008-07-23 13:21 UTC by Ville Skyttä
Modified: 2008-08-05 01:17 UTC (History)
0 users


Note You need to log in before you can comment on or make changes to this bug.
Description Ville Skyttä 2008-07-23 13:21:47 UTC
Something that changed between POI 3.0.2 and 3.1 appears to have introduced a row height problem.

All the lines created without setting the row height appear with zero height when the resulting .xls file is opened with OpenOffice 2.3 (Linux).  A workaround is to explicitly set the row height to -1 for every row after creating them.  Setting default row height to -1 in the containing sheet has no effect.

OpenOffice 2.4 (Linux) does not appear to have this problem, so this could be an OpenOffice 2.3 bug.  I don't know what other software if any might be affected, but it would be nice to get this fixed for compatibility reasons.  As said, the problem does not exist in .xls files created with POI 3.0.2, only 3.1.

There's nothing special about the way the .xls are created, just basic stuff like:

        HSSFWorkbook book = new HSSFWorkbook();
        HSSFSheet sheet = book.createSheet();
        HSSFRow row = sheet.createRow(0);
        //row.setHeight((short) -1); // this would work around the problem
        HSSFCell cell = row.createCell((short) 0);
        cell.setCellValue(new HSSFRichTextString("Foo"));
Comment 1 Yegor Kozlov 2008-08-05 01:17:56 UTC
Fixed in r682620. 

In 3.1 the creation of new rows was refactored and some defaults were changed. 
According to the XLS spec, if the row height contains the 0x8000 bit then the row is standard height. OpenOffice 2.3 and earlier don't seem to understand it.