public Formula(Cell cell, FormulaValue formulaValue, bool fAlwaysCalc, CellParsedFormula cellParsedFormula) : base(RecordType.Formula, 0) { this.val = formulaValue.Bytes; this.rw = cell.Rw; this.col = cell.Col; this.ixfe = cell.IXFe; ProcessFormulaValue(); this.fAlwaysCalc = fAlwaysCalc; //TODO add handling for shared formulas this.fShrFmla = false; this.fClearErrors = true; uint flags = 0; flags = flags | Utils.BoolToBitmask(fAlwaysCalc, 0x01); flags = flags | Utils.BoolToBitmask(fShrFmla, 0x08); flags = flags | Utils.BoolToBitmask(fClearErrors, 0x20); this.grbit = (ushort)flags; this.cce = cellParsedFormula.cce; this.ptgStack = cellParsedFormula.PtgStack; this._length = CalculateLength(); }
public void SetCellParsedFormula(CellParsedFormula cellParsedFormula) { this.cce = cellParsedFormula.cce; this.ptgStack = cellParsedFormula.PtgStack; this._length = CalculateLength(); }