poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n...@apache.org
Subject svn commit: r1729848 - in /poi/trunk/src: ooxml/testcases/org/apache/poi/xssf/ testcases/org/apache/poi/hssf/ testcases/org/apache/poi/ss/
Date Thu, 11 Feb 2016 15:13:02 GMT
Author: nick
Date: Thu Feb 11 15:13:01 2016
New Revision: 1729848

URL: http://svn.apache.org/viewvc?rev=1729848&view=rev
Log:
Allow common tests to do auto-sizing even on SXSSF

Modified:
    poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/SXSSFITestDataProvider.java
    poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/XSSFITestDataProvider.java
    poi/trunk/src/testcases/org/apache/poi/hssf/HSSFITestDataProvider.java
    poi/trunk/src/testcases/org/apache/poi/ss/ITestDataProvider.java

Modified: poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/SXSSFITestDataProvider.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/SXSSFITestDataProvider.java?rev=1729848&r1=1729847&r2=1729848&view=diff
==============================================================================
--- poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/SXSSFITestDataProvider.java (original)
+++ poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/SXSSFITestDataProvider.java Thu Feb
11 15:13:01 2016
@@ -30,7 +30,9 @@ import org.apache.poi.POIDataSamples;
 import org.apache.poi.ss.ITestDataProvider;
 import org.apache.poi.ss.SpreadsheetVersion;
 import org.apache.poi.ss.usermodel.FormulaEvaluator;
+import org.apache.poi.ss.usermodel.Sheet;
 import org.apache.poi.ss.usermodel.Workbook;
+import org.apache.poi.xssf.streaming.SXSSFSheet;
 import org.apache.poi.xssf.streaming.SXSSFWorkbook;
 import org.apache.poi.xssf.usermodel.XSSFFormulaEvaluator;
 import org.apache.poi.xssf.usermodel.XSSFWorkbook;
@@ -86,6 +88,13 @@ public final class SXSSFITestDataProvide
     }
     
     @Override
+    public void trackColumnsForAutosizing(Sheet sheet, int...columns) {
+        for (int cn : columns) {
+            ((SXSSFSheet)sheet).trackColumnForAutoSizing(cn);
+        }
+    }
+    
+    @Override
     public FormulaEvaluator createFormulaEvaluator(Workbook wb) {
         return new XSSFFormulaEvaluator(((SXSSFWorkbook) wb).getXSSFWorkbook());
     }

Modified: poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/XSSFITestDataProvider.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/XSSFITestDataProvider.java?rev=1729848&r1=1729847&r2=1729848&view=diff
==============================================================================
--- poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/XSSFITestDataProvider.java (original)
+++ poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/XSSFITestDataProvider.java Thu Feb 11
15:13:01 2016
@@ -21,6 +21,7 @@ import org.apache.poi.POIDataSamples;
 import org.apache.poi.ss.ITestDataProvider;
 import org.apache.poi.ss.SpreadsheetVersion;
 import org.apache.poi.ss.usermodel.FormulaEvaluator;
+import org.apache.poi.ss.usermodel.Sheet;
 import org.apache.poi.ss.usermodel.Workbook;
 import org.apache.poi.xssf.usermodel.XSSFFormulaEvaluator;
 import org.apache.poi.xssf.usermodel.XSSFWorkbook;
@@ -54,6 +55,9 @@ public final class XSSFITestDataProvider
     }
     
     @Override
+    public void trackColumnsForAutosizing(Sheet sheet, int...columns) {}
+   
+    @Override
     public FormulaEvaluator createFormulaEvaluator(Workbook wb) {
         return new XSSFFormulaEvaluator((XSSFWorkbook) wb);
     }

Modified: poi/trunk/src/testcases/org/apache/poi/hssf/HSSFITestDataProvider.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/hssf/HSSFITestDataProvider.java?rev=1729848&r1=1729847&r2=1729848&view=diff
==============================================================================
--- poi/trunk/src/testcases/org/apache/poi/hssf/HSSFITestDataProvider.java (original)
+++ poi/trunk/src/testcases/org/apache/poi/hssf/HSSFITestDataProvider.java Thu Feb 11 15:13:01
2016
@@ -25,6 +25,7 @@ import org.apache.poi.hssf.usermodel.HSS
 import org.apache.poi.ss.ITestDataProvider;
 import org.apache.poi.ss.SpreadsheetVersion;
 import org.apache.poi.ss.usermodel.FormulaEvaluator;
+import org.apache.poi.ss.usermodel.Sheet;
 import org.apache.poi.ss.usermodel.Workbook;
 
 /**
@@ -60,6 +61,9 @@ public final class HSSFITestDataProvider
     }
     
     @Override
+    public void trackColumnsForAutosizing(Sheet sheet, int...columns) {}
+    
+    @Override
     public FormulaEvaluator createFormulaEvaluator(Workbook wb) {
         return new HSSFFormulaEvaluator((HSSFWorkbook) wb);
     }

Modified: poi/trunk/src/testcases/org/apache/poi/ss/ITestDataProvider.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/ss/ITestDataProvider.java?rev=1729848&r1=1729847&r2=1729848&view=diff
==============================================================================
--- poi/trunk/src/testcases/org/apache/poi/ss/ITestDataProvider.java (original)
+++ poi/trunk/src/testcases/org/apache/poi/ss/ITestDataProvider.java Thu Feb 11 15:13:01 2016
@@ -18,6 +18,7 @@
 package org.apache.poi.ss;
 
 import org.apache.poi.ss.usermodel.FormulaEvaluator;
+import org.apache.poi.ss.usermodel.Sheet;
 import org.apache.poi.ss.usermodel.Workbook;
 
 /**
@@ -45,6 +46,12 @@ public interface ITestDataProvider {
      * @return an instance of Workbook
      */
     Workbook createWorkbook();
+    
+    /**
+     * Only matters for SXSSF - enables tracking of the column
+     *  widths so that autosizing can work. No-op on others.
+     */
+    void trackColumnsForAutosizing(Sheet sheet, int...columns);
 
     /**
      * Creates the corresponding {@link FormulaEvaluator} for the



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


Mime
View raw message