예제 #1
0
        public DVRecord(int validationType, int operator1, int errorStyle, bool emptyCellAllowed,
                        bool suppressDropDownArrow, bool isExplicitList,
                        bool showPromptBox, String promptTitle, String promptText,
                        bool showErrorBox, String errorTitle, String errorText,
                        Ptg[] formula1, Ptg[] formula2,
                        CellRangeAddressList regions)
        {
            int flags = 0;

            flags         = opt_data_type.SetValue(flags, validationType);
            flags         = opt_condition_operator.SetValue(flags, operator1);
            flags         = opt_error_style.SetValue(flags, errorStyle);
            flags         = opt_empty_cell_allowed.SetBoolean(flags, emptyCellAllowed);
            flags         = opt_suppress_dropdown_arrow.SetBoolean(flags, suppressDropDownArrow);
            flags         = opt_string_list_formula.SetBoolean(flags, isExplicitList);
            flags         = opt_show_prompt_on_cell_selected.SetBoolean(flags, showPromptBox);
            flags         = opt_show_error_on_invalid_value.SetBoolean(flags, showErrorBox);
            _option_flags = flags;
            _promptTitle  = ResolveTitleText(promptTitle);
            _promptText   = ResolveTitleText(promptText);
            _errorTitle   = ResolveTitleText(errorTitle);
            _errorText    = ResolveTitleText(errorText);
            _formula1     = NPOI.SS.Formula.Formula.Create(formula1);
            _formula2     = NPOI.SS.Formula.Formula.Create(formula2);
            _regions      = regions;
        }
예제 #2
0
        /**
         * Constructs a DV record and Sets its fields appropriately.
         *
         * @param in the RecordInputstream to Read the record from
         */

        public DVRecord(RecordInputStream in1)
        {
            _option_flags = in1.ReadInt();

            _promptTitle = ReadUnicodeString(in1);
            _errorTitle  = ReadUnicodeString(in1);
            _promptText  = ReadUnicodeString(in1);
            _errorText   = ReadUnicodeString(in1);

            int field_size_first_formula = in1.ReadUShort();

            _not_used_1 = in1.ReadShort();

            //read first formula data condition
            _formula1 = NPOI.SS.Formula.Formula.Read(field_size_first_formula, in1);

            int field_size_sec_formula = in1.ReadUShort();

            _not_used_2 = in1.ReadShort();

            //read sec formula data condition
            _formula2 = NPOI.SS.Formula.Formula.Read(field_size_sec_formula, in1);

            //read cell range address list with all affected ranges
            _regions = new CellRangeAddressList(in1);
        }
예제 #3
0
 /**
  * @param in the RecordInputstream to Read the record from
  */
 public SharedFormulaRecord(RecordInputStream in1)
     : base(in1)
 {
     field_5_reserved        = in1.ReadShort();
     int field_6_expression_len = in1.ReadShort();
     int nAvailableBytes = in1.Available();
     field_7_parsed_expr = NPOI.SS.Formula.Formula.Read(field_6_expression_len, in1, nAvailableBytes);
 }
예제 #4
0
        /**
         * @param in the RecordInputstream to Read the record from
         */

        public SharedFormulaRecord(RecordInputStream in1) : base(in1)
        {
            field_5_reserved = in1.ReadShort();
            int field_6_expression_len = in1.ReadShort();
            int nAvailableBytes        = in1.Available();

            field_7_parsed_expr = NPOI.SS.Formula.Formula.Read(field_6_expression_len, in1, nAvailableBytes);
        }
예제 #5
0
파일: ArrayRecord.cs 프로젝트: zzy092/npoi
        public ArrayRecord(RecordInputStream in1)
            : base(in1)
        {
            _options       = in1.ReadUShort();
            _field3notUsed = in1.ReadInt();
            int formulaTokenLen = in1.ReadUShort();
            int totalFormulaLen = in1.Available();

            _formula = NPOI.SS.Formula.Formula.Read(formulaTokenLen, in1, totalFormulaLen);
        }
예제 #6
0
        public ArrayRecord(RecordInputStream in1)
            : base(in1)
        {

            _options = in1.ReadUShort();
            _field3notUsed = in1.ReadInt();
            int formulaTokenLen = in1.ReadUShort();
		    int totalFormulaLen = in1.Available();
		    _formula = NPOI.SS.Formula.Formula.Read(formulaTokenLen, in1, totalFormulaLen);
        }
예제 #7
0
        public ExternalNameRecord(RecordInputStream in1)
        {
            field_1_option_flag = in1.ReadShort();
            field_2_index       = in1.ReadShort();
            field_3_not_used    = in1.ReadShort();
            int nameLength    = in1.ReadUByte();
            int multibyteFlag = in1.ReadUByte();

            if (multibyteFlag == 0)
            {
                field_4_name = in1.ReadCompressedUnicode(nameLength);
            }
            else
            {
                field_4_name = in1.ReadUnicodeLEString(nameLength);
            }
            if (!HasFormula)
            {
                if (!IsStdDocumentNameIdentifier && !IsOLELink && IsAutomaticLink)
                {
                    // both need to be incremented
                    int nColumns = in1.ReadUByte() + 1;
                    int nRows    = in1.ReadShort() + 1;

                    int totalCount = nRows * nColumns;
                    _ddeValues = ConstantValueParser.Parse(in1, totalCount);
                    _nColumns  = nColumns;
                    _nRows     = nRows;
                }

                if (in1.Remaining > 0)
                {
                    throw ReadFail("Some Unread data (is formula present?)");
                }
                field_5_name_definition = null;
                return;
            }
            int nBytesRemaining = in1.Available();

            if (in1.Remaining <= 0)
            {
                throw ReadFail("Ran out of record data trying to read formula.");
            }
            short formulaLen = in1.ReadShort();

            nBytesRemaining        -= 2;
            field_5_name_definition = NPOI.SS.Formula.Formula.Read(formulaLen, in1, nBytesRemaining);
        }
예제 #8
0
        /**
         * Constructs a Formula record and Sets its fields appropriately.
         * Note - id must be 0x06 (NOT 0x406 see MSKB #Q184647 for an
         * "explanation of this bug in the documentation) or an exception
         *  will be throw upon validation
         *
         * @param in the RecordInputstream to Read the record from
         */

        public FormulaRecord(RecordInputStream in1) : base(in1)
        {
            long valueLongBits = in1.ReadLong();

            field_5_options    = in1.ReadShort();
            specialCachedValue = SpecialCachedValue.Create(valueLongBits);
            if (specialCachedValue == null)
            {
                field_4_value = BitConverter.Int64BitsToDouble(valueLongBits);
            }

            field_6_zero = in1.ReadInt();
            int field_7_expression_len = in1.ReadShort();

            field_8_parsed_expr = NPOI.SS.Formula.Formula.Read(field_7_expression_len, in1, in1.Available());
        }
예제 #9
0
파일: FormulaRecord.cs 프로젝트: WPG/npoi
        /*
         * Since the NaN support seems sketchy (different constants) we'll store and spit it out directly
         */
        // fix warning CS0169 "never used": private byte[] value_data;
        // fix warning CS0169 "never used": private byte[] all_data; //if formula support is not enabled then
        //we'll just store/reSerialize

        /** Creates new FormulaRecord */

        public FormulaRecord()
        {
            field_8_parsed_expr = NPOI.SS.Formula.Formula.Create(Ptg.EMPTY_PTG_ARRAY);
        }
예제 #10
0
 public void SetParsedExpression(Ptg[] ptgs)
 {
     field_8_parsed_expr = NPOI.SS.Formula.Formula.Create(ptgs);
 }
예제 #11
0
        /*
         * Since the NaN support seems sketchy (different constants) we'll store and spit it out directly
         */
        // fix warning CS0169 "never used": private byte[] value_data;
        // fix warning CS0169 "never used": private byte[] all_data; //if formula support is not enabled then
        //we'll just store/reSerialize

        /** Creates new FormulaRecord */

        public FormulaRecord()
        {
            field_8_parsed_expr = NPOI.SS.Formula.Formula.Create(Ptg.EMPTY_PTG_ARRAY);
        }
예제 #12
0
        public ExternalNameRecord(RecordInputStream in1)
        {
            field_1_option_flag = in1.ReadShort();
            field_2_index = in1.ReadShort();
            field_3_not_used = in1.ReadShort();
            int nameLength = in1.ReadUByte();
            int multibyteFlag = in1.ReadUByte();
            if (multibyteFlag == 0)
            {
                field_4_name = in1.ReadCompressedUnicode(nameLength);
            }
            else
            {
                field_4_name = in1.ReadUnicodeLEString(nameLength);
            }            
            if (!HasFormula)
            {
                if (!IsStdDocumentNameIdentifier && !IsOLELink && IsAutomaticLink)
                {
                    // both need to be incremented
                    int nColumns = in1.ReadUByte() + 1;
                    int nRows = in1.ReadShort() + 1;

                    int totalCount = nRows * nColumns;
                    _ddeValues = ConstantValueParser.Parse(in1, totalCount);
                    _nColumns = nColumns;
                    _nRows = nRows;
                }

                if (in1.Remaining > 0)
                {
                    throw ReadFail("Some Unread data (is formula present?)");
                }
                field_5_name_definition = null;
                return;
            }
            int nBytesRemaining = in1.Available();
            if (in1.Remaining <= 0)
            {
                throw ReadFail("Ran out of record data trying to read formula.");
            }
            short formulaLen = in1.ReadShort();
            nBytesRemaining -= 2;
            field_5_name_definition = NPOI.SS.Formula.Formula.Read(formulaLen, in1, nBytesRemaining);
        }
예제 #13
0
파일: DVRecord.cs 프로젝트: 89sos98/npoi
        public DVRecord(int validationType, int operator1, int errorStyle, bool emptyCellAllowed,
            bool suppressDropDownArrow, bool isExplicitList,
            bool showPromptBox, String promptTitle, String promptText,
            bool showErrorBox, String errorTitle, String errorText,
            Ptg[] formula1, Ptg[] formula2,
            CellRangeAddressList regions)
        {

            int flags = 0;
            flags = opt_data_type.SetValue(flags, validationType);
            flags = opt_condition_operator.SetValue(flags, operator1);
            flags = opt_error_style.SetValue(flags, errorStyle);
            flags = opt_empty_cell_allowed.SetBoolean(flags, emptyCellAllowed);
            flags = opt_suppress_dropdown_arrow.SetBoolean(flags, suppressDropDownArrow);
            flags = opt_string_list_formula.SetBoolean(flags, isExplicitList);
            flags = opt_show_prompt_on_cell_selected.SetBoolean(flags, showPromptBox);
            flags = opt_show_error_on_invalid_value.SetBoolean(flags, showErrorBox);
            _option_flags = flags;
            _promptTitle = ResolveTitleText(promptTitle);
            _promptText = ResolveTitleText(promptText);
            _errorTitle = ResolveTitleText(errorTitle);
            _errorText = ResolveTitleText(errorText);
            _formula1 = NPOI.SS.Formula.Formula.Create(formula1);
            _formula2 = NPOI.SS.Formula.Formula.Create(formula2);
            _regions = regions;
        }
예제 #14
0
파일: ArrayRecord.cs 프로젝트: zzy092/npoi
 public ArrayRecord(NPOI.SS.Formula.Formula formula, CellRangeAddress8Bit range) : base(range)
 {
     _options       = 0; //YK: Excel 2007 leaves this field unset
     _field3notUsed = 0;
     _formula       = formula;
 }
예제 #15
0
 public ArrayRecord(NPOI.SS.Formula.Formula formula, CellRangeAddress8Bit range):base(range)
 {
     _options = 0; //YK: Excel 2007 leaves this field unset
     _field3notUsed = 0;
     _formula = formula;
 }
예제 #16
0
파일: FormulaRecord.cs 프로젝트: WPG/npoi
        /**
         * Constructs a Formula record and Sets its fields appropriately.
         * Note - id must be 0x06 (NOT 0x406 see MSKB #Q184647 for an 
         * "explanation of this bug in the documentation) or an exception
         *  will be throw upon validation
         *
         * @param in the RecordInputstream to Read the record from
         */

        public FormulaRecord(RecordInputStream in1):base(in1)
        {
		        long valueLongBits  = in1.ReadLong();
		        field_5_options = in1.ReadShort();
		        specialCachedValue = SpecialCachedValue.Create(valueLongBits);
		        if (specialCachedValue == null) {
			        field_4_value = BitConverter.Int64BitsToDouble(valueLongBits);
		        }

                field_6_zero = in1.ReadInt();
                int field_7_expression_len = in1.ReadShort();

                field_8_parsed_expr = NPOI.SS.Formula.Formula.Read(field_7_expression_len, in1,in1.Available());
        }
예제 #17
0
파일: FormulaRecord.cs 프로젝트: WPG/npoi
 public void SetParsedExpression(Ptg[] ptgs)
 {
     field_8_parsed_expr = NPOI.SS.Formula.Formula.Create(ptgs);
 }
예제 #18
0
파일: DVRecord.cs 프로젝트: 89sos98/npoi
        /**
         * Constructs a DV record and Sets its fields appropriately.
         *
         * @param in the RecordInputstream to Read the record from
         */

        public DVRecord(RecordInputStream in1)
        {
            _option_flags = in1.ReadInt();

            _promptTitle = ReadUnicodeString(in1);
            _errorTitle = ReadUnicodeString(in1);
            _promptText = ReadUnicodeString(in1);
            _errorText = ReadUnicodeString(in1);

            int field_size_first_formula = in1.ReadUShort();
            _not_used_1 = in1.ReadShort();

            //read first formula data condition
            _formula1 = NPOI.SS.Formula.Formula.Read(field_size_first_formula, in1);

            int field_size_sec_formula = in1.ReadUShort();
            _not_used_2 = in1.ReadShort();

            //read sec formula data condition
            _formula2 = NPOI.SS.Formula.Formula.Read(field_size_sec_formula, in1);

            //read cell range address list with all affected ranges
            _regions = new CellRangeAddressList(in1);
        }