Bugzilla 51356: Support autoSizeColumn in SXSSF

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1134721 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Yegor Kozlov 2011-06-11 18:17:15 +00:00
parent 07253cbc8b
commit 7351a3794c
2 changed files with 7 additions and 2 deletions

View 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>

View 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));
}
}
/**