Exemplo n.º 1
0
        // Insert cell, which must be Formula, as array formula
        // in area ((ulCol,ulRow), (lrCol, lrRow))
        public void SetArrayFormula(Cell cell, int col, int row, CellAddr ulCa, CellAddr lrCa)
        {
            Formula formula = cell as Formula;

            if (cell == null)
            {
                throw new Exception("Invalid array formula");
            }
            else
            {
                CachedArrayFormula caf = new CachedArrayFormula(formula, this, col, row, ulCa, lrCa);
                // Increase support sets of cells referred by formula
                formula.AddToSupportSets(this, col, row, 1, 1);
                Interval displayCols = new Interval(ulCa.col, lrCa.col),
                         displayRows = new Interval(ulCa.row, lrCa.row);
                // The underlying formula supports (only) the ArrayFormula cells in display range
                formula.ResetSupportSet();
                formula.AddSupport(this, col, row, this, displayCols, displayRows);
                int cols = lrCa.col - ulCa.col + 1, rows = lrCa.row - ulCa.row + 1;
                for (int c = 0; c < cols; c++)
                {
                    for (int r = 0; r < rows; r++)
                    {
                        this[ulCa.col + c, ulCa.row + r] = new ArrayFormula(caf, c, r);
                    }
                }
            }
        }
Exemplo n.º 2
0
		public ArrayFormula(CachedArrayFormula caf, int col, int row)
			: this(caf, new CellAddr(col, row)) {}
Exemplo n.º 3
0
 public ArrayFormula(CachedArrayFormula caf, int col, int row)
     : this(caf, new CellAddr(col, row))
 {
 }
Exemplo n.º 4
0
		private readonly CellAddr ca; // Cell's location within array value

		public ArrayFormula(CachedArrayFormula caf, CellAddr ca) {
			this.caf = caf;
			this.ca = ca;
		}
Exemplo n.º 5
0
        private readonly CellAddr ca;           // Cell's location within array value

        public ArrayFormula(CachedArrayFormula caf, CellAddr ca)
        {
            this.caf = caf;
            this.ca  = ca;
        }