Пример #1
0
 public AreaEval Offset(int relFirstRowIx, int relLastRowIx, int relFirstColIx, int relLastColIx)
 {
     if (_refEval == null)
     {
         return(_areaEval.Offset(relFirstRowIx, relLastRowIx, relFirstColIx, relLastColIx));
     }
     return(_refEval.Offset(relFirstRowIx, relLastRowIx, relFirstColIx, relLastColIx));
 }
Пример #2
0
        private static AreaEval ResolveRange(RefEval reA, RefEval reB)
        {

            int height = reB.Row - reA.Row;
            int width = reB.Column - reA.Column;

            return reA.Offset(0, height, 0, width);
        }
Пример #3
0
        /**
         * The second argument (table_array) should be an area ref, but can actually be a cell ref, in
         * which case it Is interpreted as a 1x1 area ref.  Other scalar values cause #VALUE! error.
         */
        public static AreaEval ResolveTableArrayArg(ValueEval eval)
        {
            if (eval is AreaEval)
            {
                return((AreaEval)eval);
            }

            if (eval is RefEval)
            {
                RefEval refEval = (RefEval)eval;
                // Make this cell ref look like a 1x1 area ref.

                // It doesn't matter if eval is a 2D or 3D ref, because that detail is never asked of AreaEval.
                return(refEval.Offset(0, 0, 0, 0));
            }
            throw EvaluationException.InvalidValue();
        }