public void testGetColumnWidth() { InternalSheet worksheet = InternalSheet.createSheet(); // shall not be NPE worksheet.getColumnWidth( 0 ); HSSFWorkbook wb = HSSFTestDataSamples .openSampleWorkbook( "12843-1.xls" ); HSSFSheet sheet = wb.getSheetAt( 7 ); // shall not be NPE sheet.getColumnWidth( 0 ); } Second call to getColumnWidth() throws NPE due to missing defaultcolwidth
Also happens with 34775.xls, 44010-SingleChart.xls, 44010-TwoCharts.xls. Seems defaultcolwidth may miss if sheet contains only charts
Created attachment 27286 [details] proposed patch based on different open source projects (i.e. googled for constant)
Applied in r1147049 along with a unit test. The proposed defaults agree with the Excel documentation. The default column width in Excel is eight characters (this is true for both binary and OOXML formats). The default row height is 255 twips (12.75 pt). Regards, Yegor