示例#1
0
        /**
         * Public function which removes any data validation, if present
         */
        public virtual void removeDataValidation()
        {
            if (!dataValidation)
            {
                return;
            }

            // If the data validation is shared, then generate a warning
            DVParser dvp = getDVParser();

            if (dvp.extendedCellsValidation())
            {
                //logger.warn("Cannot remove data validation from " +
                //            CellReferenceHelper.getCellReference(writableCell) +
                //            " as it is part of the shared reference " +
                //            CellReferenceHelper.getCellReference(dvp.getFirstColumn(),
                //                                                 dvp.getFirstRow()) +
                //            "-" +
                //            CellReferenceHelper.getCellReference(dvp.getLastColumn(),
                //                                                 dvp.getLastRow()));
                return;
            }

            // Remove the validation from the WritableSheet object if present
            writableCell.removeDataValidation();
            clearValidationSettings();
        }
示例#2
0
        /**
         * Constructor called when doing a cell deep copy
         */
        public DVParser(DVParser copy)
        {
            wasCopied                  = true;
            type                       = copy.type;
            errorStyle                 = copy.errorStyle;
            condition                  = copy.condition;
            stringListGiven            = copy.stringListGiven;
            emptyCellsAllowed          = copy.emptyCellsAllowed;
            suppressArrow              = copy.suppressArrow;
            showPrompt                 = copy.showPrompt;
            showError                  = copy.showError;
            promptTitle                = copy.promptTitle;
            promptText                 = copy.promptText;
            errorTitle                 = copy.errorTitle;
            errorText                  = copy.errorText;
            hasExtendedCellsValidation = copy.extendedCellsValidation();

            row1    = copy.row1;
            row2    = copy.row2;
            column1 = copy.column1;
            column2 = copy.column2;

            // Don't copy the formula parsers - just take their string equivalents
            if (copy.formula1String != null)
            {
                formula1String = copy.formula1String;
                formula2String = copy.formula2String;
            }
            else
            {
                try
                {
                    formula1String = copy.formula1.getFormula();
                    formula2String = (copy.formula2 != null) ?
                                     copy.formula2.getFormula() : null;
                }
                catch (FormulaException e)
                {
                    //logger.warn("Cannot parse validation formula:  " + e.Message);
                }
            }
            // Don't copy the cell references - these will be added later
        }
示例#3
0
        /**
         * Constructor called when doing a cell deep copy
         */
        public DVParser(DVParser copy)
        {
            wasCopied = true;
            type = copy.type;
            errorStyle = copy.errorStyle;
            condition = copy.condition;
            stringListGiven = copy.stringListGiven;
            emptyCellsAllowed = copy.emptyCellsAllowed;
            suppressArrow = copy.suppressArrow;
            showPrompt = copy.showPrompt;
            showError = copy.showError;
            promptTitle = copy.promptTitle;
            promptText = copy.promptText;
            errorTitle = copy.errorTitle;
            errorText = copy.errorText;
            hasExtendedCellsValidation = copy.extendedCellsValidation();

            row1 = copy.row1;
            row2 = copy.row2;
            column1 = copy.column1;
            column2 = copy.column2;

            // Don't copy the formula parsers - just take their string equivalents
            if (copy.formula1String != null)
                {
                formula1String = copy.formula1String;
                formula2String = copy.formula2String;
                }
            else
                {
                try
                    {
                    formula1String = copy.formula1.getFormula();
                    formula2String = (copy.formula2 != null) ?
                      copy.formula2.getFormula() : null;
                    }
                catch (FormulaException e)
                    {
                    //logger.warn("Cannot parse validation formula:  " + e.Message);
                    }
                }
            // Don't copy the cell references - these will be added later
        }