Class PtgShifter


  • public class PtgShifter
    extends Object
    Shift a cell address in a Ptg 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 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 method
        currentExternSheetIx - - the extern sheet index of the sheet that contains the formula being adjusted
        Returns:
        true if a change was made to the formula tokens
      • createDeletedRef

        public static Ptg createDeletedRef​(Ptg ptg)
      • createDeletedRef3d

        public static Ptg createDeletedRef3d​(String bookName,
                                             Ptg ptg)