From: Javen O'Neal Date: Mon, 2 Nov 2015 02:22:03 +0000 (+0000) Subject: replace deprecated usage of FormulaShifter.createForRowShift X-Git-Tag: REL_3_14_BETA1~180 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=de13fd818ac4bf3b6b12a6195f984dd91cad364b;p=poi.git replace deprecated usage of FormulaShifter.createForRowShift git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1711879 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/java/org/apache/poi/hssf/usermodel/HSSFSheet.java b/src/java/org/apache/poi/hssf/usermodel/HSSFSheet.java index 7442cf98fc..4d28ef62fc 100644 --- a/src/java/org/apache/poi/hssf/usermodel/HSSFSheet.java +++ b/src/java/org/apache/poi/hssf/usermodel/HSSFSheet.java @@ -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(); diff --git a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSheet.java b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSheet.java index 4651a204ea..d40e30783f 100644 --- a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSheet.java +++ b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSheet.java @@ -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); diff --git a/src/testcases/org/apache/poi/hssf/model/TestSheet.java b/src/testcases/org/apache/poi/hssf/model/TestSheet.java index 9699788291..fca517d23e 100644 --- a/src/testcases/org/apache/poi/hssf/model/TestSheet.java +++ b/src/testcases/org/apache/poi/hssf/model/TestSheet.java @@ -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 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");