From 2765285706c2c4002f074f67b1daaced7faa747d Mon Sep 17 00:00:00 2001 From: Yegor Kozlov Date: Tue, 15 Jul 2008 18:13:50 +0000 Subject: [PATCH] fixed bug #45322: HSSFSheet.autoSizeColumn() throws NPE when cell number format was not found git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@676995 13f79535-47bb-0310-9956-ffa450edef68 --- src/documentation/content/xdocs/changes.xml | 1 + src/documentation/content/xdocs/status.xml | 1 + .../poi/hssf/usermodel/HSSFCellStyle.java | 10 ++++++---- .../apache/poi/hssf/usermodel/HSSFSheet.java | 4 +--- .../org/apache/poi/hssf/data/45322.xls | Bin 0 -> 86528 bytes .../org/apache/poi/hssf/usermodel/TestBugs.java | 9 +++++++++ 6 files changed, 18 insertions(+), 7 deletions(-) create mode 100644 src/testcases/org/apache/poi/hssf/data/45322.xls diff --git a/src/documentation/content/xdocs/changes.xml b/src/documentation/content/xdocs/changes.xml index 15f1a29d5..12f62cb8b 100644 --- a/src/documentation/content/xdocs/changes.xml +++ b/src/documentation/content/xdocs/changes.xml @@ -37,6 +37,7 @@ + 45322 - Fixed NPE in HSSFSheet.autoSizeColumn() when cell number format was not found 45380 - Missing return keyword in ArrayPtg.toFormulaString() 44958 - Record level support for Data Tables. (No formula parser support though) 35583 - Include a version class, org.apache.poi.Version, to allow easy introspection of the POI version diff --git a/src/documentation/content/xdocs/status.xml b/src/documentation/content/xdocs/status.xml index b77bcae69..a62ee3dde 100644 --- a/src/documentation/content/xdocs/status.xml +++ b/src/documentation/content/xdocs/status.xml @@ -34,6 +34,7 @@ + 45322 - Fixed NPE in HSSFSheet.autoSizeColumn() when cell number format was not found 45380 - Missing return keyword in ArrayPtg.toFormulaString() 44958 - Record level support for Data Tables. (No formula parser support though) 35583 - Include a version class, org.apache.poi.Version, to allow easy introspection of the POI version diff --git a/src/java/org/apache/poi/hssf/usermodel/HSSFCellStyle.java b/src/java/org/apache/poi/hssf/usermodel/HSSFCellStyle.java index c613225ba..6d8ae33b6 100644 --- a/src/java/org/apache/poi/hssf/usermodel/HSSFCellStyle.java +++ b/src/java/org/apache/poi/hssf/usermodel/HSSFCellStyle.java @@ -278,21 +278,23 @@ public class HSSFCellStyle * Get the contents of the format string, by looking up * the DataFormat against the bound workbook * @see org.apache.poi.hssf.usermodel.HSSFDataFormat + * @return the format string or "General" if not found */ public String getDataFormatString() { - HSSFDataFormat format = new HSSFDataFormat(workbook); - - return format.getFormat(getDataFormat()); + return getDataFormatString(workbook); } /** * Get the contents of the format string, by looking up * the DataFormat against the supplied workbook * @see org.apache.poi.hssf.usermodel.HSSFDataFormat + * + * @return the format string or "General" if not found */ public String getDataFormatString(Workbook workbook) { HSSFDataFormat format = new HSSFDataFormat(workbook); - return format.getFormat(getDataFormat()); + int idx = getDataFormat(); + return idx == -1 ? "General" : format.getFormat(getDataFormat()); } /** diff --git a/src/java/org/apache/poi/hssf/usermodel/HSSFSheet.java b/src/java/org/apache/poi/hssf/usermodel/HSSFSheet.java index 2b6ad4139..e2973df23 100644 --- a/src/java/org/apache/poi/hssf/usermodel/HSSFSheet.java +++ b/src/java/org/apache/poi/hssf/usermodel/HSSFSheet.java @@ -1851,9 +1851,7 @@ public final class HSSFSheet { } else { String sval = null; if (cell.getCellType() == HSSFCell.CELL_TYPE_NUMERIC) { - HSSFDataFormat dataformat = wb.createDataFormat(); - short idx = style.getDataFormat(); - String format = dataformat.getFormat(idx).replaceAll("\"", ""); + String format = style.getDataFormatString().replaceAll("\"", ""); double value = cell.getNumericCellValue(); try { NumberFormat fmt; diff --git a/src/testcases/org/apache/poi/hssf/data/45322.xls b/src/testcases/org/apache/poi/hssf/data/45322.xls new file mode 100644 index 0000000000000000000000000000000000000000..711721400e984db67c87bbf23d0b7e579f0218fc GIT binary patch literal 86528 zcmeI*2b3FGb{Op9>_p}~%?##D0u7)6Fg7}n-DD?rU^90!G|6VpIW%+5nZulO&RR*c zO4iydtt?quWsP>NWJ~f&URk^LO5=O)OLcKE`)kjy|M#(vIj5%h9)Jq(t9#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testcases/org/apache/poi/hssf/usermodel/TestBugs.java +++ b/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java @@ -1353,4 +1353,13 @@ public final class TestBugs extends TestCase { // TODO - check the formula once tables and // arrays are properly supported } + + /** + * 45322: HSSFSheet.autoSizeColumn fails when style.getDataFormat() returns -1 + */ + public void test45322() throws Exception { + HSSFWorkbook wb = openSample("44958.xls"); + HSSFSheet sh = wb.getSheetAt(0); + for(short i=0; i < 30; i++) sh.autoSizeColumn(i); + } }