src/org/tiefaces/components/websheet/utility/ShiftFormulaUtility.java
protected static Object fixupRefRelativeRowOneToOne(final Object ptg,
			final Row newRow) {
		if (ptg instanceof RefPtgBase) {
			if (ptg instanceof Ref3DPxg) {
				Ref3DPxg ref3dPxg = (Ref3DPxg) ptg;
				Ref3DPxg new3dpxg = new Ref3DPxg(
						ref3dPxg.getExternalWorkbookNumber(),
						new SheetIdentifier(null,
								new NameIdentifier(ref3dPxg.getSheetName(),
										false)),
						new CellReference(newRow.getRowNum(),
								ref3dPxg.getColumn()));
				new3dpxg.setClass(ref3dPxg.getPtgClass());
				new3dpxg.setColRelative(ref3dPxg.isColRelative());
				new3dpxg.setRowRelative(ref3dPxg.isRowRelative());
				new3dpxg.setLastSheetName(ref3dPxg.getLastSheetName());
				return new3dpxg;
			} else {
				RefPtgBase refPtgBase = (RefPtgBase) ptg;
				return new RefPtg(newRow.getRowNum(),
						refPtgBase.getColumn(), refPtgBase.isRowRelative(),
						refPtgBase.isColRelative());

			}
		} else {
			if (ptg instanceof Area3DPxg) {
				Area3DPxg area3dPxg = (Area3DPxg) ptg;
				Area3DPxg new3dpxg = new Area3DPxg(
						area3dPxg.getExternalWorkbookNumber(),
						new SheetIdentifier(null,
								new NameIdentifier(area3dPxg.getSheetName(),
										false)),
						area3dPxg.format2DRefAsString());
				new3dpxg.setClass(area3dPxg.getPtgClass());
				new3dpxg.setFirstColRelative(
						area3dPxg.isFirstColRelative());
				new3dpxg.setLastColRelative(area3dPxg.isLastColRelative());
				int shiftRow = newRow.getRowNum() - area3dPxg.getFirstRow();
				new3dpxg.setFirstRow(area3dPxg.getFirstRow() + shiftRow);
				new3dpxg.setLastRow(area3dPxg.getLastRow() + shiftRow);
				new3dpxg.setFirstRowRelative(
						area3dPxg.isFirstRowRelative());
				new3dpxg.setLastRowRelative(area3dPxg.isLastRowRelative());
				new3dpxg.setLastSheetName(area3dPxg.getLastSheetName());
				return new3dpxg;
			} else {
				AreaPtgBase areaPtgBase = (AreaPtgBase) ptg;
				int shiftRow = newRow.getRowNum()
						- areaPtgBase.getFirstRow();
				return new AreaPtg(areaPtgBase.getFirstRow() + shiftRow,
						areaPtgBase.getLastRow() + shiftRow,
						areaPtgBase.getFirstColumn(),
						areaPtgBase.getLastColumn(),
						areaPtgBase.isFirstRowRelative(),
						areaPtgBase.isLastRowRelative(),
						areaPtgBase.isFirstColRelative(),
						areaPtgBase.isLastColRelative());
			}
		}

	}
protected static Object fixupRefRelativeRowOneToOne(final Object ptg,
			final Row newRow) {
		if (ptg instanceof RefPtgBase) {
			if (ptg instanceof Ref3DPxg) {
				Ref3DPxg ref3dPxg = (Ref3DPxg) ptg;
				Ref3DPxg new3dpxg = new Ref3DPxg(
						ref3dPxg.getExternalWorkbookNumber(),
						new SheetIdentifier(null,
								new NameIdentifier(ref3dPxg.getSheetName(),
										false)),
						new CellReference(newRow.getRowNum(),
								ref3dPxg.getColumn()));
				new3dpxg.setClass(ref3dPxg.getPtgClass());
				new3dpxg.setColRelative(ref3dPxg.isColRelative());
				new3dpxg.setRowRelative(ref3dPxg.isRowRelative());
				new3dpxg.setLastSheetName(ref3dPxg.getLastSheetName());
				return new3dpxg;
			} else {
				RefPtgBase refPtgBase = (RefPtgBase) ptg;
				return new RefPtg(newRow.getRowNum(),
						refPtgBase.getColumn(), refPtgBase.isRowRelative(),
						refPtgBase.isColRelative());

			}
		} else {
			if (ptg instanceof Area3DPxg) {
				Area3DPxg area3dPxg = (Area3DPxg) ptg;
				Area3DPxg new3dpxg = new Area3DPxg(
						area3dPxg.getExternalWorkbookNumber(),
						new SheetIdentifier(null,
								new NameIdentifier(area3dPxg.getSheetName(),
										false)),
						area3dPxg.format2DRefAsString());
				new3dpxg.setClass(area3dPxg.getPtgClass());
				new3dpxg.setFirstColRelative(
						area3dPxg.isFirstColRelative());
				new3dpxg.setLastColRelative(area3dPxg.isLastColRelative());
				int shiftRow = newRow.getRowNum() - area3dPxg.getFirstRow();
				new3dpxg.setFirstRow(area3dPxg.getFirstRow() + shiftRow);
				new3dpxg.setLastRow(area3dPxg.getLastRow() + shiftRow);
				new3dpxg.setFirstRowRelative(
						area3dPxg.isFirstRowRelative());
				new3dpxg.setLastRowRelative(area3dPxg.isLastRowRelative());
				new3dpxg.setLastSheetName(area3dPxg.getLastSheetName());
				return new3dpxg;
			} else {
				AreaPtgBase areaPtgBase = (AreaPtgBase) ptg;
				int shiftRow = newRow.getRowNum()
						- areaPtgBase.getFirstRow();
				return new AreaPtg(areaPtgBase.getFirstRow() + shiftRow,
						areaPtgBase.getLastRow() + shiftRow,
						areaPtgBase.getFirstColumn(),
						areaPtgBase.getLastColumn(),
						areaPtgBase.isFirstRowRelative(),
						areaPtgBase.isLastRowRelative(),
						areaPtgBase.isFirstColRelative(),
						areaPtgBase.isLastColRelative());
			}
		}

	}
protected static Object fixupRefRelativeRowOneToOne ( final Object ptg , final Row newRow ) { if ( ptg instanceof RefPtgBase ) { if ( ptg instanceof Ref3DPxg ) { Ref3DPxg ref3dPxg = ( Ref3DPxg ) ptg ; Ref3DPxg new3dpxg = new Ref3DPxg ( ref3dPxg . getExternalWorkbookNumber ( ) , new SheetIdentifier ( null , new NameIdentifier ( ref3dPxg . getSheetName ( ) , false ) ) , new CellReference ( newRow . getRowNum ( ) , ref3dPxg . getColumn ( ) ) ) ; new3dpxg . setClass ( ref3dPxg . getPtgClass ( ) ) ; new3dpxg . setColRelative ( ref3dPxg . isColRelative ( ) ) ; new3dpxg . setRowRelative ( ref3dPxg . isRowRelative ( ) ) ; new3dpxg . setLastSheetName ( ref3dPxg . getLastSheetName ( ) ) ; return new3dpxg ; } else { RefPtgBase refPtgBase = ( RefPtgBase ) ptg ; return new RefPtg ( newRow . getRowNum ( ) , refPtgBase . getColumn ( ) , refPtgBase . isRowRelative ( ) , refPtgBase . isColRelative ( ) ) ; } } else { if ( ptg instanceof Area3DPxg ) { Area3DPxg area3dPxg = ( Area3DPxg ) ptg ; Area3DPxg new3dpxg = new Area3DPxg ( area3dPxg . getExternalWorkbookNumber ( ) , new SheetIdentifier ( null , new NameIdentifier ( area3dPxg . getSheetName ( ) , false ) ) , area3dPxg . format2DRefAsString ( ) ) ; new3dpxg . setClass ( area3dPxg . getPtgClass ( ) ) ; new3dpxg . setFirstColRelative ( area3dPxg . isFirstColRelative ( ) ) ; new3dpxg . setLastColRelative ( area3dPxg . isLastColRelative ( ) ) ; int shiftRow = newRow . getRowNum ( ) - area3dPxg . getFirstRow ( ) ; new3dpxg . setFirstRow ( area3dPxg . getFirstRow ( ) + shiftRow ) ; new3dpxg . setLastRow ( area3dPxg . getLastRow ( ) + shiftRow ) ; new3dpxg . setFirstRowRelative ( area3dPxg . isFirstRowRelative ( ) ) ; new3dpxg . setLastRowRelative ( area3dPxg . isLastRowRelative ( ) ) ; new3dpxg . setLastSheetName ( area3dPxg . getLastSheetName ( ) ) ; return new3dpxg ; } else { AreaPtgBase areaPtgBase = ( AreaPtgBase ) ptg ; int shiftRow = newRow . getRowNum ( ) - areaPtgBase . getFirstRow ( ) ; return new AreaPtg ( areaPtgBase . getFirstRow ( ) + shiftRow , areaPtgBase . getLastRow ( ) + shiftRow , areaPtgBase . getFirstColumn ( ) , areaPtgBase . getLastColumn ( ) , areaPtgBase . isFirstRowRelative ( ) , areaPtgBase . isLastRowRelative ( ) , areaPtgBase . isFirstColRelative ( ) , areaPtgBase . isLastColRelative ( ) ) ; } } }
Fixup ref relative row one to one.

@param ptg
the ptg
@param newRow
the new row
@return the object
Fixup ref relative row one to one .