Package org.apache.poi.ss.formula
Class PtgShifter
- java.lang.Object
-
- org.apache.poi.ss.formula.PtgShifter
-
public class PtgShifter extends Object
Shift a cell address in aPtg
according to cell operations including cut, copy/paste, insertion, and deletion.- absolute formula doesn't change copy and auto-fill operation, but move, insert and delete operations still change absolute formulas
- 3D multiple sheets formula, Sheet1:Sheet3!A1, doesn't change for insertion and deletion.
- 1 sheet formula, Sheet1!A1, changes for insertion and deletion.
- copy/paste, cut doesn't change a whole row/column cell address e.g. A:C or 3:5
- Author:
- henrichen
-
-
Constructor Summary
Constructors Constructor Description PtgShifter(int externSheetIndex, int firstRow, int lastRow, int rowAmount, int firstCol, int lastCol, int colAmount, SpreadsheetVersion ver)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
adjustFormula(Ptg[] ptgs, int currentExternSheetIx)
static Ptg
createDeletedRef(Ptg ptg)
static Ptg
createDeletedRef3d(String bookName, Ptg ptg)
String
toString()
-
-
-
Constructor Detail
-
PtgShifter
public PtgShifter(int externSheetIndex, int firstRow, int lastRow, int rowAmount, int firstCol, int lastCol, int colAmount, SpreadsheetVersion ver)
-
-
Method Detail
-
adjustFormula
public boolean adjustFormula(Ptg[] ptgs, int currentExternSheetIx)
- Parameters:
ptgs
- - if necessary, will get modified by this methodcurrentExternSheetIx
- - the extern sheet index of the sheet that contains the formula being adjusted- Returns:
true
if a change was made to the formula tokens
-
-