Bug 52314

Summary: SheetUtil.getColumnWidth could be more flexible.
Product: POI Reporter: Jim Talbut <jim-apache>
Component: POI OverallAssignee: POI Developers List <dev>
Severity: normal    
Priority: P2    
Version: 3.8-dev   
Target Milestone: ---   
Hardware: PC   
OS: Windows Vista   
Attachments: Patch to make column width calculations a bit more useful.

Description Jim Talbut 2011-12-09 16:29:09 UTC
Created attachment 28061 [details]
Patch to make column width calculations a bit more useful.

Headers rows in a sheet often contain titles that are expected to run over into subsequent columns, so I'd like to be able to ignore some rows at the start.
Measuring every single cell can be prohibitively expensive for large sheets, and typically the results are no better than can be obtained from the first few rows.

With the current level of privacy in SheetUtil it's awkward to make use of it.
It would be more useful if SheetUtil was refactored to have:
1. A new method that took first/last row index as parameters.
2. The bulk of getColumnWidth extracted to be getCellWidth so callers can use it any way they want.
Comment 1 Yegor Kozlov 2011-12-16 10:01:20 UTC
Applied in r1215079