]> source.dussan.org Git - poi.git/commitdiff
Patch from bug #51785 - Allow XSSF setForceFormulaRecalculation to work with the...
authorNick Burch <nick@apache.org>
Fri, 9 Sep 2011 15:11:20 +0000 (15:11 +0000)
committerNick Burch <nick@apache.org>
Fri, 9 Sep 2011 15:11:20 +0000 (15:11 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1167241 13f79535-47bb-0310-9956-ffa450edef68

src/documentation/content/xdocs/status.xml
src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFSheet.java

index b1682fecdf4d1a38ce4ddaf0b557cc3f1d3bd1d3..246288823babb331c11cb0cfa9585111517d02ac 100644 (file)
@@ -34,6 +34,7 @@
 
     <changes>
         <release version="3.8-beta5" date="2011-??-??">
+           <action dev="poi-developers" type="fix">51785 - Allow XSSF setForceFormulaRecalculation to work with the minimal ooxml-schemas jar</action>
            <action dev="poi-developers" type="fix">51772 - IllegalArgumentException Parsing MS Word 97 - 2003</action>
            <action dev="poi-developers" type="add">XSLFPowerPointExtractor support for including comment authors with comment text</action>
            <action dev="poi-developers" type="fix">Converted XSLFPowerPointExtractor to use UserModel for all text extraction</action>
index ad02fa69e1b6ac55a83909e0588f95b6593c0d40..141a06fdbf43580d5f4cbcc05cd0fd46e3a4aa0d 100644 (file)
@@ -1063,4 +1063,25 @@ public final class TestXSSFSheet extends BaseTestSheet {
        XSSFSheet s3 = wb.getSheetAt(2);
        assertEquals(0, s3.getTables().size());
     }
+    
+    /**
+     * Test to trigger OOXML-LITE generating to include org.openxmlformats.schemas.spreadsheetml.x2006.main.CTSheetCalcPr
+     */
+    public void testSetForceFormulaRecalculation() {
+          XSSFWorkbook workbook = new XSSFWorkbook();
+         XSSFSheet sheet = workbook.createSheet("Sheet 1");
+
+         // Set
+         sheet.setForceFormulaRecalculation(true);
+         assertEquals(true, sheet.getForceFormulaRecalculation());
+         
+         // Check
+         sheet.setForceFormulaRecalculation(false);
+         assertEquals(false, sheet.getForceFormulaRecalculation());
+         
+         // Save, re-load, and re-check
+         workbook = XSSFTestDataSamples.writeOutAndReadBack(workbook);
+         sheet = workbook.getSheet("Sheet 1");
+         assertEquals(false, sheet.getForceFormulaRecalculation());
+       }
 }