diff --git a/src/documentation/content/xdocs/changes.xml b/src/documentation/content/xdocs/changes.xml index e313d8ced4..e23cb3169f 100644 --- a/src/documentation/content/xdocs/changes.xml +++ b/src/documentation/content/xdocs/changes.xml @@ -37,6 +37,7 @@ + 45645 - Fix for HSSFSheet.autoSizeColumn() for widths exceeding Short.MAX_VALUE 45623 - Support for additional HSSF header and footer fields, including bold and full file path 45623 - Support stripping HSSF header and footer fields (eg page number) out of header and footer text if required 45622 - Support stripping HWPF fields (eg macros) out of text, via Range.stripFields(text) diff --git a/src/documentation/content/xdocs/status.xml b/src/documentation/content/xdocs/status.xml index f0352ea5f4..33c86d5896 100644 --- a/src/documentation/content/xdocs/status.xml +++ b/src/documentation/content/xdocs/status.xml @@ -34,6 +34,7 @@ + 45645 - Fix for HSSFSheet.autoSizeColumn() for widths exceeding Short.MAX_VALUE 45623 - Support for additional HSSF header and footer fields, including bold and full file path 45623 - Support stripping HSSF header and footer fields (eg page number) out of header and footer text if required 45622 - Support stripping HWPF fields (eg macros) out of text, via Range.stripFields(text) diff --git a/src/java/org/apache/poi/hssf/usermodel/HSSFSheet.java b/src/java/org/apache/poi/hssf/usermodel/HSSFSheet.java index 84a71a89aa..ef3d58006d 100644 --- a/src/java/org/apache/poi/hssf/usermodel/HSSFSheet.java +++ b/src/java/org/apache/poi/hssf/usermodel/HSSFSheet.java @@ -1787,10 +1787,11 @@ public final class HSSFSheet { } if (width != -1) { + width *= 256; if (width > Short.MAX_VALUE) { //width can be bigger that Short.MAX_VALUE! width = Short.MAX_VALUE; } - sheet.setColumnWidth(column, (short) (width * 256)); + sheet.setColumnWidth(column, (short) (width)); } }