]> source.dussan.org Git - poi.git/commitdiff
replace deprecated usage of FormulaShifter.createForRowShift
authorJaven O'Neal <onealj@apache.org>
Mon, 2 Nov 2015 02:22:03 +0000 (02:22 +0000)
committerJaven O'Neal <onealj@apache.org>
Mon, 2 Nov 2015 02:22:03 +0000 (02:22 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1711879 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/poi/hssf/usermodel/HSSFSheet.java
src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSheet.java
src/testcases/org/apache/poi/hssf/model/TestSheet.java

index 7442cf98fcba71d40e0f6e165e7562786fb67393..4d28ef62fcb1be811b0b2d20b6f212266b0fb306 100644 (file)
@@ -1567,7 +1567,7 @@ public final class HSSFSheet implements org.apache.poi.ss.usermodel.Sheet {
         String sheetName = _workbook.getSheetName(sheetIndex);
         short externSheetIndex = _book.checkExternSheet(sheetIndex);
         FormulaShifter shifter = FormulaShifter.createForRowShift(
-                         externSheetIndex, sheetName, startRow, endRow, n);
+                         externSheetIndex, sheetName, startRow, endRow, n, SpreadsheetVersion.EXCEL97);
         _sheet.updateFormulasAfterCellShift(shifter, externSheetIndex);
 
         int nSheets = _workbook.getNumberOfSheets();
index 4651a204ea32459245e4617a37ba40c709147ed9..d40e30783f703612846a9570cac3ec834500b93e 100644 (file)
@@ -2755,7 +2755,7 @@ public class XSSFSheet extends POIXMLDocumentPart implements Sheet {
         int sheetIndex = getWorkbook().getSheetIndex(this);
         String sheetName = getWorkbook().getSheetName(sheetIndex);
         FormulaShifter shifter = FormulaShifter.createForRowShift(
-                                   sheetIndex, sheetName, startRow, endRow, n);
+                                   sheetIndex, sheetName, startRow, endRow, n, SpreadsheetVersion.EXCEL2007);
 
         rowShifter.updateNamedRanges(shifter);
         rowShifter.updateFormulas(shifter);
index 969978829108f504129a6386721ab151ec2f7772..fca517d23e4aacb396d25c3995f746ecad6526a1 100644 (file)
@@ -62,6 +62,7 @@ import org.apache.poi.hssf.usermodel.HSSFRow;
 import org.apache.poi.hssf.usermodel.HSSFSheet;
 import org.apache.poi.hssf.usermodel.HSSFWorkbook;
 import org.apache.poi.hssf.usermodel.RecordInspector.RecordCollector;
+import org.apache.poi.ss.SpreadsheetVersion;
 import org.apache.poi.ss.formula.FormulaShifter;
 import org.apache.poi.ss.util.CellRangeAddress;
 import org.apache.poi.util.HexRead;
@@ -680,7 +681,7 @@ public final class TestSheet {
                List<RecordBase> sheetRecs = sheet.getRecords();
                assertEquals(23, sheetRecs.size());
 
-               FormulaShifter shifter = FormulaShifter.createForRowShift(0, "", 0, 0, 1);
+               FormulaShifter shifter = FormulaShifter.createForRowShift(0, "", 0, 0, 1, SpreadsheetVersion.EXCEL97);
                sheet.updateFormulasAfterCellShift(shifter, 0);
                if (sheetRecs.size() == 24 && sheetRecs.get(22) instanceof ConditionalFormattingTable) {
                        throw new AssertionFailedError("Identified bug 46547a");