]> source.dussan.org Git - poi.git/commitdiff
Bugzilla 51356: Support autoSizeColumn in SXSSF
authorYegor Kozlov <yegor@apache.org>
Sat, 11 Jun 2011 18:17:15 +0000 (18:17 +0000)
committerYegor Kozlov <yegor@apache.org>
Sat, 11 Jun 2011 18:17:15 +0000 (18:17 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1134721 13f79535-47bb-0310-9956-ffa450edef68

src/documentation/content/xdocs/status.xml
src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFSheet.java

index 0c6acd0ce8010aa3246d33540b52ff47caebb7a9..5700f1debd837e2bd80a72b14f8612e430ad4c45 100644 (file)
@@ -34,6 +34,7 @@
 
     <changes>
         <release version="3.8-beta4" date="2011-??-??">
+           <action dev="poi-developers" type="add">51356 - Support autoSizeColumn in SXSSF</action>
            <action dev="poi-developers" type="add">51335 - Parse picture goal and crop sizes in HWPF</action>
            <action dev="poi-developers" type="add">51305 - Add sprmTCellPaddingDefault support in HWPF</action>
            <action dev="poi-developers" type="add">51265 - Enhanced Handling of Picture Parts in XWPF</action>
index f5d2dc4395f22d5221b579695e5e6ab9bac850fe..e5e27cdfe11329d1aa4bac13ba5a340883f35653 100644 (file)
@@ -26,6 +26,7 @@ import org.apache.poi.hpsf.IllegalPropertySetDataException;
 import org.apache.poi.ss.usermodel.*;
 import org.apache.poi.ss.util.CellReference;
 
+import org.apache.poi.ss.util.SheetUtil;
 import org.apache.poi.xssf.usermodel.XSSFSheet;
 
 import org.apache.poi.hssf.util.PaneInformation;
@@ -1049,7 +1050,7 @@ public class SXSSFSheet implements Sheet, Cloneable
      */
     public void autoSizeColumn(int column)
     {
-        _sh.autoSizeColumn(column);
+        autoSizeColumn(column, false);
     }
 
     /**
@@ -1067,7 +1068,10 @@ public class SXSSFSheet implements Sheet, Cloneable
      */
     public void autoSizeColumn(int column, boolean useMergedCells)
     {
-        _sh.autoSizeColumn(column, useMergedCells);
+        double width = SheetUtil.getColumnWidth(this, column, useMergedCells);
+        if(width != -1){
+            setColumnWidth(column, (int)(width*256));
+        }
     }
 
     /**