<changes>
<release version="3.5-beta7" date="2009-??-??">
+ <action dev="POI-DEVELOPERS" type="fix">47411 - Explicitly set the 1900 date system when creating XSSF workbooks</action>
<action dev="POI-DEVELOPERS" type="add">47400 - Support fo text extraction of footnotes, endnotes and comments in HWPF</action>
<action dev="POI-DEVELOPERS" type="fix">47415 - Fixed PageSettingsBlock to allow multiple PLS records</action>
<action dev="POI-DEVELOPERS" type="fix">47412 - Fixed concurrency issue with EscherProperties.initProps()</action>
*/
private void onWorkbookCreate() {
workbook = CTWorkbook.Factory.newInstance();
+
+ // don't EVER use the 1904 date system
+ CTWorkbookPr workbookPr = workbook.addNewWorkbookPr();
+ workbookPr.setDate1904(false);
+
CTBookViews bvs = workbook.addNewBookViews();
CTBookView bv = bvs.addNewWorkbookView();
bv.setActiveTab(0);
import org.apache.poi.openxml4j.opc.PackagingURIHelper;
import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTSheet;
import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTWorkbook;
+import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTWorkbookPr;
public final class TestXSSFWorkbook extends BaseTestWorkbook {
*/
public void testSaveLoadNew() throws Exception {
XSSFWorkbook workbook = new XSSFWorkbook();
- Sheet sheet1 = workbook.createSheet("sheet1");
+
+ //check that the default date system is set to 1900
+ CTWorkbookPr pr = workbook.getCTWorkbook().getWorkbookPr();
+ assertNotNull(pr);
+ assertTrue(pr.isSetDate1904());
+ assertFalse("XSSF must use the 1900 date system", pr.getDate1904());
+
+ Sheet sheet1 = workbook.createSheet("sheet1");
Sheet sheet2 = workbook.createSheet("sheet2");
workbook.createSheet("sheet3");