poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ye...@apache.org
Subject svn commit: r564689 - /poi/trunk/src/java/org/apache/poi/hssf/usermodel/HSSFSheet.java
Date Fri, 10 Aug 2007 17:34:58 GMT
Author: yegor
Date: Fri Aug 10 10:34:57 2007
New Revision: 564689

URL: http://svn.apache.org/viewvc?view=rev&rev=564689
Log:
Bug 43090: autoSizeColumn can calculate negative sizes for the column width due to a cast
from integer to short

Modified:
    poi/trunk/src/java/org/apache/poi/hssf/usermodel/HSSFSheet.java

Modified: poi/trunk/src/java/org/apache/poi/hssf/usermodel/HSSFSheet.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/usermodel/HSSFSheet.java?view=diff&rev=564689&r1=564688&r2=564689
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/usermodel/HSSFSheet.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/usermodel/HSSFSheet.java Fri Aug 10 10:34:57 2007
@@ -1505,6 +1505,9 @@
             }
 
             if (width != -1) {
+                if (width > Short.MAX_VALUE) { //width can be bigger that Short.MAX_VALUE!
+                     width = Short.MAX_VALUE;
+                }
                 sheet.setColumnWidth(column, (short) (width * 256));
             }
         }



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org


Mime
View raw message