import org.apache.poi.poifs.filesystem.NPOIFSFileSystem;
import org.apache.poi.poifs.filesystem.Ole10Native;
import org.apache.poi.poifs.filesystem.POIFSFileSystem;
+import org.apache.poi.ss.SpreadsheetVersion;
import org.apache.poi.ss.formula.FormulaShifter;
import org.apache.poi.ss.formula.FormulaType;
import org.apache.poi.ss.formula.SheetNameFormatter;
public InternalWorkbook getInternalWorkbook() {
return workbook;
}
+
+ /**
+ * Returns the spreadsheet version (EXCLE97) of this workbook
+ *
+ * @return EXCEL97 SpreadsheetVersion enum
+ * @since 3.14 beta 2
+ */
+ @Override
+ public SpreadsheetVersion getSpreadsheetVersion() {
+ return SpreadsheetVersion.EXCEL97;
+ }
}
import java.util.Iterator;
import java.util.List;
+import org.apache.poi.ss.SpreadsheetVersion;
import org.apache.poi.ss.formula.udf.UDFFinder;
import org.apache.poi.ss.usermodel.Row.MissingCellPolicy;
import org.apache.poi.ss.util.CellRangeAddress;
* @since 3.8
*/
boolean getForceFormulaRecalculation();
+
+ /**
+ * Returns the spreadsheet version of this workbook
+ *
+ * @return SpreadsheetVersion enum
+ * @since 3.14 beta 2
+ */
+ public SpreadsheetVersion getSpreadsheetVersion();
}
import org.apache.poi.openxml4j.opc.OPCPackage;
import org.apache.poi.openxml4j.opc.internal.ZipHelper;
+import org.apache.poi.ss.SpreadsheetVersion;
import org.apache.poi.ss.formula.udf.UDFFinder;
import org.apache.poi.ss.usermodel.CellStyle;
import org.apache.poi.ss.usermodel.CreationHelper;
return _wb.getForceFormulaRecalculation();
}
+ /**
+ * Returns the spreadsheet version (EXCLE2007) of this workbook
+ *
+ * @return EXCEL2007 SpreadsheetVersion enum
+ * @since 3.14 beta 2
+ */
+ @Override
+ public SpreadsheetVersion getSpreadsheetVersion() {
+ return SpreadsheetVersion.EXCEL2007;
+ }
+
//end of interface implementation
}
import org.apache.poi.openxml4j.opc.PackagingURIHelper;
import org.apache.poi.openxml4j.opc.TargetMode;
import org.apache.poi.poifs.crypt.HashAlgorithm;
+import org.apache.poi.ss.SpreadsheetVersion;
import org.apache.poi.ss.formula.SheetNameFormatter;
import org.apache.poi.ss.formula.udf.IndexedUDFFinder;
import org.apache.poi.ss.formula.udf.UDFFinder;
setVBAProject(vbaProjectStream);
}
}
+
+ /**
+ * Returns the spreadsheet version (EXCLE2007) of this workbook
+ *
+ * @return EXCEL2007 SpreadsheetVersion enum
+ * @since 3.14 beta 2
+ */
+ @Override
+ public SpreadsheetVersion getSpreadsheetVersion() {
+ return SpreadsheetVersion.EXCEL2007;
+ }
}
import java.io.IOException;
import org.apache.poi.POITestCase;
+import org.apache.poi.ss.SpreadsheetVersion;
import org.apache.poi.ss.usermodel.BaseTestWorkbook;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
import org.junit.Test;
public final class TestSXSSFWorkbook extends BaseTestWorkbook {
- public static final SXSSFITestDataProvider _testDataProvider = SXSSFITestDataProvider.instance;
+ private static final SXSSFITestDataProvider _testDataProvider = SXSSFITestDataProvider.instance;
public TestSXSSFWorkbook() {
super(_testDataProvider);
streamingWorkBook.close();
workBook.close();
}
+
+ @Test
+ @Override
+ public void getSpreadsheetVersion() throws IOException {
+ verifySpreadsheetVersion(SpreadsheetVersion.EXCEL2007);
+ }
}
import org.openxmlformats.schemas.spreadsheetml.x2006.main.STCalcMode;
public final class TestXSSFWorkbook extends BaseTestWorkbook {
+ private static final XSSFITestDataProvider _testDataProvider = XSSFITestDataProvider.instance;
public TestXSSFWorkbook() {
- super(XSSFITestDataProvider.instance);
+ super(_testDataProvider);
}
/**
assertTrue(file.delete());
}
}
+
+ @Test
+ @Override
+ public void getSpreadsheetVersion() throws IOException {
+ verifySpreadsheetVersion(SpreadsheetVersion.EXCEL2007);
+ }
}
import org.apache.poi.poifs.filesystem.DirectoryNode;
import org.apache.poi.poifs.filesystem.NPOIFSFileSystem;
import org.apache.poi.poifs.filesystem.POIFSFileSystem;
+import org.apache.poi.ss.SpreadsheetVersion;
import org.apache.poi.ss.formula.ptg.Area3DPtg;
import org.apache.poi.ss.usermodel.BaseTestWorkbook;
import org.apache.poi.ss.usermodel.Name;
* Tests for {@link HSSFWorkbook}
*/
public final class TestHSSFWorkbook extends BaseTestWorkbook {
+ private static final HSSFITestDataProvider _testDataProvider = HSSFITestDataProvider.instance;
+
public TestHSSFWorkbook() {
- super(HSSFITestDataProvider.instance);
+ super(_testDataProvider);
}
/**
fileOut.close();
}
+
+ @Test
+ @Override
+ public void getSpreadsheetVersion() throws IOException {
+ verifySpreadsheetVersion(SpreadsheetVersion.EXCEL97);
+ }
}
import java.util.Iterator;
import org.apache.poi.ss.ITestDataProvider;
+import org.apache.poi.ss.SpreadsheetVersion;
import org.apache.poi.ss.util.CellRangeAddress;
import org.junit.Test;
b.close();
}
+
+ @Test
+ public abstract void getSpreadsheetVersion() throws IOException;
+
+ protected void verifySpreadsheetVersion(SpreadsheetVersion expected) throws IOException {
+ final Workbook wb = _testDataProvider.createWorkbook();
+ assertEquals(expected, wb.getSpreadsheetVersion());
+ wb.close();
+ }
}