Bug 46447 - Applying style with big font does not update row height attributes
Summary: Applying style with big font does not update row height attributes
Status: RESOLVED INFORMATIONPROVIDED
Alias: None
Product: POI
Classification: Unclassified
Component: HSSF (show other bugs)
Version: 3.5-dev
Hardware: PC Windows XP
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on: 47658
Blocks:
  Show dependency tree
 
Reported: 2008-12-29 23:24 UTC by Antti Koskimäki
Modified: 2020-03-08 08:41 UTC (History)
0 users



Attachments
source and excel to re-produce the bug (6.34 KB, application/zip)
2008-12-29 23:24 UTC, Antti Koskimäki
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Antti Koskimäki 2008-12-29 23:24:02 UTC
Created attachment 23062 [details]
source and excel to re-produce the bug

If I apply style with large font to cell, i.e. "insert large text", the resulting excel does have row tall enough to contain the text (font) but row.getHeight() still returns original height value.

This happens even after reading the excel back (so it's consistent, nothing magic there either :=)

But, after saving the resulted excel with Excel (2003) and reading THAT back to POI, the height-attributes are set to match the font, as expected.

Tested with latest r729456. Source and excels to reproduce attached.
Comment 1 Antti Koskimäki 2009-01-07 01:38:39 UTC
> resulting excel does have row tall enough to contain the text (font) but
> row.getHeight() still returns original height value.

Another case related to here; if I have cell having "wrap text" option set, and row was therefore stretched, the getHeight() returns that stretched size, even after replacing the row contents with something that fits in "single height".

I.e. the height value is not (re-)set here either.

Comment 2 Dominik Stadler 2020-03-08 08:37:26 UTC
As far as I see you are not adjusting the height of the row anywhere and Apache POI does not try to auto-size row-height based on fonts used in any cell. 

So by specifying the row-height via

row.setHeightInPoints((short)30);

before writing the file you should be able to get the expected behavior.