Example #1
0
        /**
         * @throws RuntimeException if the bounds are exceeded.
         */
        private static void CheckBounds(int cellIndex)
        {
            SpreadsheetVersion v = SpreadsheetVersion.EXCEL2007;
            int maxcol           = SpreadsheetVersion.EXCEL2007.LastColumnIndex;

            if (cellIndex < 0 || cellIndex > maxcol)
            {
                throw new ArgumentException("Invalid column index (" + cellIndex
                                            + ").  Allowable column range for " + v.ToString() + " is (0.."
                                            + maxcol + ") or ('A'..'" + v.LastColumnName + "')");
            }
        }
Example #2
0
 private static void ConfirmCrInRange(bool expResult, String colStr, String rowStr,
                                      SpreadsheetVersion sv)
 {
     if (expResult == CellReference.CellReferenceIsWithinRange(colStr, rowStr, sv))
     {
         return;
     }
     throw new AssertionException("expected (c='" + colStr + "', r='" + rowStr + "' to be "
                                  + (expResult ? "within" : "out of") + " bounds for version " + sv.ToString());
 }
Example #3
0
        private static void CheckBounds(int cellIndex)
        {
            SpreadsheetVersion exceL2007 = SpreadsheetVersion.EXCEL2007;
            int lastColumnIndex          = SpreadsheetVersion.EXCEL2007.LastColumnIndex;

            if (cellIndex < 0 || cellIndex > lastColumnIndex)
            {
                throw new ArgumentException("Invalid column index (" + (object)cellIndex + ").  Allowable column range for " + exceL2007.ToString() + " is (0.." + (object)lastColumnIndex + ") or ('A'..'" + exceL2007.LastColumnName + "')");
            }
        }