Exemplo n.º 1
0
        /** Creates new ErrPtg */

        public ErrPtg(int errorCode)
        {
            if (!HSSFErrorConstants.IsValidCode(errorCode))
            {
                throw new ArgumentException("Invalid error code (" + errorCode + ")");
            }
            field_1_error_code = errorCode;
        }
Exemplo n.º 2
0
        /**
         * Converts error codes to text.  Handles non-standard error codes OK.
         * For debug/test purposes (and for formatting error messages).
         * @return the String representation of the specified Excel error code.
         */
        public static String GetText(int errorCode)
        {
            if (HSSFErrorConstants.IsValidCode(errorCode))
            {
                return(HSSFErrorConstants.GetText(errorCode));
            }
            // It is desirable to make these (arbitrary) strings look clearly different from any other
            // value expression that might appear in a formula.  In Addition these error strings should
            // look Unlike the standard Excel errors.  Hence tilde ('~') was used.
            switch (errorCode)
            {
            case CIRCULAR_REF_ERROR_CODE: return("~CIRCULAR~REF~");

            case FUNCTION_NOT_IMPLEMENTED_CODE: return("~FUNCTION~NOT~IMPLEMENTED~");
            }
            return("~non~std~err(" + errorCode + ")~");
        }