pullUpdatedValue method

String pullUpdatedValue(
  1. String cellRef
)

This method retrieves the value in the requested cell reference using fresh computations for any cells that affect the value of the requested cell.

Implementation

String pullUpdatedValue(String cellRef) {
  bool isUseFormulaValueChanged = false;
  _inAPull = true;
  _multiTick = false;
  final Worksheet? grd = _grid;
  final String saveCell = _cell;
  final String s = cellRef.toUpperCase();

  _updateCalcID();
  String txt = '';
  if (!_dependentFormulaCells!.containsKey(s) &&
      !_formulaInfoTable!.containsKey(s)) {
    txt = _getValueFromParentObject(s, true);

    if (_useFormulaValues) {
      isUseFormulaValueChanged = true;
      _useFormulaValues = false;
    }

    _useFormulaValues = isUseFormulaValueChanged;
    final bool saveIVC = _ignoreValueChanged;
    _ignoreValueChanged = true;
    final int row = _getRowIndex(s);
    final int col = _getColIndex(s);
    _grid!.setValueRowCol(txt, row, col);
    _ignoreValueChanged = saveIVC;
  }

  _grid = grd;
  _cell = saveCell;
  _inAPull = false;

  return txt;
}