]> source.dussan.org Git - poi.git/commitdiff
fixed bug #45645: Fix for HSSFSheet.autoSizeColumn() for widths exceeding Short.MAX_VALUE
authorYegor Kozlov <yegor@apache.org>
Mon, 18 Aug 2008 18:33:58 +0000 (18:33 +0000)
committerYegor Kozlov <yegor@apache.org>
Mon, 18 Aug 2008 18:33:58 +0000 (18:33 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@686844 13f79535-47bb-0310-9956-ffa450edef68

src/documentation/content/xdocs/changes.xml
src/documentation/content/xdocs/status.xml
src/java/org/apache/poi/hssf/usermodel/HSSFSheet.java

index e313d8ced4f4d9422492f793aa717a9e463c9691..e23cb3169fabd4a0ff53e72924646a82e6e886e3 100644 (file)
@@ -37,6 +37,7 @@
 
                <!-- Don't forget to update status.xml too! -->
         <release version="3.1.1-alpha1" date="2008-??-??">
+           <action dev="POI-DEVELOPERS" type="fix">45645 - Fix for HSSFSheet.autoSizeColumn() for widths exceeding Short.MAX_VALUE</action>
            <action dev="POI-DEVELOPERS" type="add">45623 - Support for additional HSSF header and footer fields, including bold and full file path</action>
            <action dev="POI-DEVELOPERS" type="add">45623 - Support stripping HSSF header and footer fields (eg page number) out of header and footer text if required</action>
            <action dev="POI-DEVELOPERS" type="add">45622 - Support stripping HWPF fields (eg macros) out of text, via Range.stripFields(text)</action>
index f0352ea5f4d9591ebced115b086f6ee56cebf040..33c86d589670b463b65381a7070ce44c19a7bcb6 100644 (file)
@@ -34,6 +34,7 @@
        <!-- Don't forget to update changes.xml too! -->
     <changes>
         <release version="3.1.1-alpha1" date="2008-??-??">
+           <action dev="POI-DEVELOPERS" type="fix">45645 - Fix for HSSFSheet.autoSizeColumn() for widths exceeding Short.MAX_VALUE</action>
            <action dev="POI-DEVELOPERS" type="add">45623 - Support for additional HSSF header and footer fields, including bold and full file path</action>
            <action dev="POI-DEVELOPERS" type="add">45623 - Support stripping HSSF header and footer fields (eg page number) out of header and footer text if required</action>
            <action dev="POI-DEVELOPERS" type="add">45622 - Support stripping HWPF fields (eg macros) out of text, via Range.stripFields(text)</action>
index 84a71a89aa999a3cf90f831c100ed393da0bc6f9..ef3d58006d114767f6f1a7ac78d4fbdd31dc8d82 100644 (file)
@@ -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));
         }
     }