コード例 #1
0
        /**
         * Constructs this object from the raw data.  Used when reading in a
         * format record
         *
         * @param t the raw data
         * @param ws the workbook settings
         * @param dummy dummy overload
         */
        public FontRecord(Record t, WorkbookSettings ws, Biff7 dummy)
            : base(t)
        {
            byte[] data = getRecord().getData();

            pointHeight    = IntegerHelper.getInt(data[0], data[1]) / EXCEL_UNITS_PER_POINT;
            colourIndex    = IntegerHelper.getInt(data[4], data[5]);
            boldWeight     = IntegerHelper.getInt(data[6], data[7]);
            scriptStyle    = IntegerHelper.getInt(data[8], data[9]);
            underlineStyle = data[10];
            fontFamily     = data[11];
            initialized    = false;

            if ((data[2] & 0x02) != 0)
            {
                italic = true;
            }

            if ((data[2] & 0x08) != 0)
            {
                struckout = true;
            }

            int numChars = data[14];

            name = StringHelper.getString(data, numChars, 15, ws);
        }
コード例 #2
0
ファイル: DValParser.cs プロジェクト: ferrinsp/kbellfireapp
        /**
         * Gets the data
         */
        public virtual byte[] getData()
        {
            byte[] data = new byte[18];

            int options = 0;

            if (promptBoxVisible)
            {
                options |= PROMPT_BOX_VISIBLE_MASK;
            }

            if (promptBoxAtCell)
            {
                options |= PROMPT_BOX_AT_CELL_MASK;
            }

            if (validityDataCached)
            {
                options |= VALIDITY_DATA_CACHED_MASK;
            }

            IntegerHelper.getTwoBytes(options, data, 0);
            IntegerHelper.getFourBytes(objectId, data, 10);
            IntegerHelper.getFourBytes(numDVRecords, data, 14);

            return(data);
        }
コード例 #3
0
 /**
  * Constructor
  */
 public DataValidityListRecord(Record t)
     : base(t)
 {
     data        = getRecord().getData();
     objectId    = (uint)IntegerHelper.getInt(data[10], data[11], data[12], data[13]);
     numSettings = IntegerHelper.getInt(data[14], data[15], data[16], data[17]);
 }
コード例 #4
0
        /**
         * Retrieves the data for output to binary file
         *
         * @return the data to be written
         */
        public override byte[] getData()
        {
            if (!modified)
            {
                return(data);
            }

            byte[] d = new byte[14 + ranges.Length * 8];

            // Copy in the original information
            System.Array.Copy(data, 0, d, 0, 4);

            // Create the new range
            IntegerHelper.getTwoBytes(enclosingRange.firstRow, d, 4);
            IntegerHelper.getTwoBytes(enclosingRange.lastRow, d, 6);
            IntegerHelper.getTwoBytes(enclosingRange.firstColumn, d, 8);
            IntegerHelper.getTwoBytes(enclosingRange.lastColumn, d, 10);

            IntegerHelper.getTwoBytes(numRanges, d, 12);

            int pos = 14;

            for (int i = 0; i < ranges.Length; i++)
            {
                IntegerHelper.getTwoBytes(ranges[i].firstRow, d, pos);
                IntegerHelper.getTwoBytes(ranges[i].lastRow, d, pos + 2);
                IntegerHelper.getTwoBytes(ranges[i].firstColumn, d, pos + 4);
                IntegerHelper.getTwoBytes(ranges[i].lastColumn, d, pos + 6);
                pos += 8;
            }

            return(d);
        }
コード例 #5
0
ファイル: WritableRecordData.cs プロジェクト: morninn/PetSof
        /**
         * Used when writing out records.  This portion of the method handles the
         * biff code and the length of the record and appends on the data retrieved
         * from the subclasses
         *
         * @return the full record data to be written out to the compound file
         */
        public virtual byte[] getBytes()
        {
            byte[] data = getData();

            int dataLength = data.Length;

            // Don't the call the automatic continuation code for now
            //    Assert.verify(dataLength <= maxRecordLength - 4);
            // If the bytes length is greater than the max record length
            // then split out the data set into continue records
            if (data.Length > maxRecordLength - 4)
            {
                dataLength = maxRecordLength - 4;
                data       = handleContinueRecords(data);
            }

            byte[] bytes = new byte[data.Length + 4];

            System.Array.Copy(data, 0, bytes, 4, data.Length);

            IntegerHelper.getTwoBytes(getCode(), bytes, 0);
            IntegerHelper.getTwoBytes(dataLength, bytes, 2);

            return(bytes);
        }
コード例 #6
0
        /**
         * Accessor for the binary data - used when copying
         *
         * @return the binary data
         */
        public override byte[] getData()
        {
            // Palette was read in, but has not been changed
            if (read && !dirty)
            {
                return(getRecord().getData());
            }

            byte[] data = new byte[numColours * 4 + 2];
            int    pos  = 0;

            // Set the number of records
            IntegerHelper.getTwoBytes(numColours, data, pos);

            // Set the rgb content
            for (int i = 0; i < numColours; i++)
            {
                pos           = i * 4 + 2;
                data[pos]     = (byte)rgbColours[i].getRed();
                data[pos + 1] = (byte)rgbColours[i].getGreen();
                data[pos + 2] = (byte)rgbColours[i].getBlue();
            }

            return(data);
        }
コード例 #7
0
        /**
         * Constructs this object from the raw data
         *
         * @param t the raw data
         */
        public WorkspaceInformationRecord(Record t)
            : base(t)
        {
            byte[] data = getRecord().getData();

            wsoptions      = IntegerHelper.getInt(data[0], data[1]);
            fitToPages     = (wsoptions | FIT_TO_PAGES) != 0;
            rowOutlines    = (wsoptions | SHOW_ROW_OUTLINE_SYMBOLS) != 0;
            columnOutlines = (wsoptions | SHOW_COLUMN_OUTLINE_SYMBOLS) != 0;
        }
コード例 #8
0
ファイル: BaseCompoundFile.cs プロジェクト: morninn/PetSof
            /**
             * Constructs a property set
             *
             * @param d the bytes
             */
            public PropertyStorage(byte[] d)
            {
                data = d;
                int nameSize = IntegerHelper.getInt(data[SIZE_OF_NAME_POS], data[SIZE_OF_NAME_POS + 1]);

                if (nameSize > SIZE_OF_NAME_POS)
                {
                    //logger.warn("property set name exceeds max length - truncating");
                    nameSize = SIZE_OF_NAME_POS;
                }
                type   = data[TYPE_POS];
                colour = data[COLOUR_POS];

                startBlock = IntegerHelper.getInt
                                 (data[START_BLOCK_POS],
                                 data[START_BLOCK_POS + 1],
                                 data[START_BLOCK_POS + 2],
                                 data[START_BLOCK_POS + 3]);
                size = IntegerHelper.getInt
                           (data[SIZE_POS],
                           data[SIZE_POS + 1],
                           data[SIZE_POS + 2],
                           data[SIZE_POS + 3]);
                previous = IntegerHelper.getInt
                               (data[PREVIOUS_POS],
                               data[PREVIOUS_POS + 1],
                               data[PREVIOUS_POS + 2],
                               data[PREVIOUS_POS + 3]);
                next = IntegerHelper.getInt
                           (data[NEXT_POS],
                           data[NEXT_POS + 1],
                           data[NEXT_POS + 2],
                           data[NEXT_POS + 3]);
                child = IntegerHelper.getInt
                            (data[CHILD_POS],
                            data[CHILD_POS + 1],
                            data[CHILD_POS + 2],
                            data[CHILD_POS + 3]);

                int chars = 0;

                if (nameSize > 2)
                {
                    chars = (nameSize - 1) / 2;
                }

                StringBuilder n = new StringBuilder(string.Empty);

                for (int i = 0; i < chars; i++)
                {
                    n.Append((char)data[i * 2]);
                }

                name = n.ToString();
            }
コード例 #9
0
        /**
         * Constructs this object from the raw data.  Used when reading in a
         * format record
         *
         * @param t the raw data
         * @param ws the workbook settings
         * @param biffType biff type dummy overload
         */
        public FormatRecord(Record t, WorkbookSettings ws, BiffType biffType)
            : base(t)
        {
            byte[] data = getRecord().getData();
            indexCode   = IntegerHelper.getInt(data[0], data[1]);
            initialized = true;

            if (biffType == biff8)
            {
                int numchars = IntegerHelper.getInt(data[2], data[3]);
                if (data[4] == 0)
                {
                    formatString = StringHelper.getString(data, numchars, 5, ws);
                }
                else
                {
                    formatString = StringHelper.getUnicodeString(data, numchars, 5);
                }
            }
            else
            {
                int    numchars = data[2];
                byte[] chars    = new byte[numchars];
                System.Array.Copy(data, 3, chars, 0, chars.Length);

                UnicodeEncoding enc = new UnicodeEncoding();
                formatString = enc.GetString(chars);
//				formatString = new string(chars);		uses platform default charset -- should be unicode, right?
            }

            date   = false;
            number = false;

            // First see if this is a date format
            for (int i = 0; i < dateStrings.Length; i++)
            {
                string dateString = dateStrings[i];
                if (formatString.IndexOf(dateString) != -1 ||
                    formatString.IndexOf(dateString.ToUpper()) != -1)
                {
                    date = true;
                    break;
                }
            }

            // See if this is number format - look for the # or 0 characters
            if (!date)
            {
                if (formatString.IndexOf('#') != -1 ||
                    formatString.IndexOf('0') != -1)
                {
                    number = true;
                }
            }
        }
コード例 #10
0
        /**
         * Used to get the data when writing out the format record
         *
         * @return the raw data
         */
        public override byte[] getData()
        {
            data = new byte[formatString.Length * 2 + 3 + 2];

            IntegerHelper.getTwoBytes(indexCode, data, 0);
            IntegerHelper.getTwoBytes(formatString.Length, data, 2);
            data[4] = (byte)0x1;             // unicode indicator
            StringHelper.getUnicodeBytes(formatString, data, 5);

            return(data);
        }
コード例 #11
0
ファイル: DValParser.cs プロジェクト: ferrinsp/kbellfireapp
        /**
         * Constructor
         */
        public DValParser(byte[] data)
        {
            int options = IntegerHelper.getInt(data[0], data[1]);

            promptBoxVisible   = (options & PROMPT_BOX_VISIBLE_MASK) != 0;
            promptBoxAtCell    = (options & PROMPT_BOX_AT_CELL_MASK) != 0;
            validityDataCached = (options & VALIDITY_DATA_CACHED_MASK) != 0;

            objectId     = (uint)IntegerHelper.getInt(data[10], data[11], data[12], data[13]);
            numDVRecords = IntegerHelper.getInt(data[14], data[15],
                                                data[16], data[17]);
        }
コード例 #12
0
        /**
         * Gets the byte data for writing out
         *
         * @return the raw data
         */
        public override byte[] getData()
        {
            byte[] data = new byte[16 + name.Length * 2];

            // Excel expects font heights in 1/20ths of a point
            IntegerHelper.getTwoBytes(pointHeight * EXCEL_UNITS_PER_POINT, data, 0);

            // Set the font attributes to be zero for now
            if (italic)
            {
                data[2] |= 0x2;
            }

            if (struckout)
            {
                data[2] |= 0x08;
            }

            // Set the index to the colour palette
            IntegerHelper.getTwoBytes(colourIndex, data, 4);

            // Bold style
            IntegerHelper.getTwoBytes(boldWeight, data, 6);

            // Script style
            IntegerHelper.getTwoBytes(scriptStyle, data, 8);

            // Underline style
            data[10] = (byte)underlineStyle;

            // Set the font family to be 0
            data[11] = fontFamily;

            // Set the character set to be zero
            data[12] = characterSet;

            // Set the reserved bit to be zero
            data[13] = 0;

            // Set the length of the font name
            data[14] = (byte)name.Length;

            data[15] = (byte)1;

            // Copy in the string
            StringHelper.getUnicodeBytes(name, data, 16);

            return(data);
        }
コード例 #13
0
ファイル: BaseCompoundFile.cs プロジェクト: morninn/PetSof
            /**
             * Constructs an empty property set.  Used when writing the file
             *
             * @param name the property storage name
             */
            public PropertyStorage(string name)
            {
                data = new byte[PROPERTY_STORAGE_BLOCK_SIZE];

                Assert.verify(name.Length < 32);

                IntegerHelper.getTwoBytes((name.Length + 1) * 2,
                                          data,
                                          SIZE_OF_NAME_POS);
                // add one to the name length to allow for the null character at
                // the end
                for (int i = 0; i < name.Length; i++)
                {
                    data[i * 2] = (byte)name[i];
                }
            }
コード例 #14
0
        /**
         * Initialize the record data
         */
        private void initialize()
        {
            byte[] data = getRecord().getData();

            int numrecords = IntegerHelper.getInt(data[0], data[1]);

            for (int i = 0; i < numrecords; i++)
            {
                int pos   = i * 4 + 2;
                int red   = IntegerHelper.getInt(data[pos], (byte)0);
                int green = IntegerHelper.getInt(data[pos + 1], (byte)0);
                int blue  = IntegerHelper.getInt(data[pos + 2], (byte)0);
                rgbColours[i] = new RGB(red, green, blue);
            }

            initialized = true;
        }
コード例 #15
0
        /**
         * Constructs this object from the raw data.  Used when reading in a
         * format record
         *
         * @param t the raw data
         * @param ws the workbook settings
         */
        public FontRecord(Record t, WorkbookSettings ws)
            : base(t)
        {
            byte[] data = getRecord().getData();

            pointHeight    = IntegerHelper.getInt(data[0], data[1]) / EXCEL_UNITS_PER_POINT;
            colourIndex    = IntegerHelper.getInt(data[4], data[5]);
            boldWeight     = IntegerHelper.getInt(data[6], data[7]);
            scriptStyle    = IntegerHelper.getInt(data[8], data[9]);
            underlineStyle = data[10];
            fontFamily     = data[11];
            characterSet   = data[12];
            initialized    = false;

            if ((data[2] & 0x02) != 0)
            {
                italic = true;
            }

            if ((data[2] & 0x08) != 0)
            {
                struckout = true;
            }

            int numChars = data[14];

            if (data[15] == 0)
            {
                name = StringHelper.getString(data, numChars, 16, ws);
            }
            else if (data[15] == 1)
            {
                name = StringHelper.getUnicodeString(data, numChars, 16);
            }
            else
            {
                // Some font names don't have the unicode indicator
                name = StringHelper.getString(data, numChars, 15, ws);
            }
        }
コード例 #16
0
        /**
         * Gets the binary data for output to file
         *
         * @return the binary data
         */
        public override byte[] getData()
        {
            byte[] data = new byte[2];

            if (fitToPages)
            {
                wsoptions |= FIT_TO_PAGES;
            }

            if (rowOutlines)
            {
                wsoptions |= SHOW_ROW_OUTLINE_SYMBOLS;
            }

            if (columnOutlines)
            {
                wsoptions |= SHOW_COLUMN_OUTLINE_SYMBOLS;
            }

            IntegerHelper.getTwoBytes(wsoptions, data, 0);

            return(data);
        }
コード例 #17
0
        /**
         * Initialization function
         */
        private void initialize()
        {
            enclosingRange             = new Range();
            enclosingRange.firstRow    = IntegerHelper.getInt(data[4], data[5]);
            enclosingRange.lastRow     = IntegerHelper.getInt(data[6], data[7]);
            enclosingRange.firstColumn = IntegerHelper.getInt(data[8], data[9]);
            enclosingRange.lastColumn  = IntegerHelper.getInt(data[10], data[11]);
            numRanges = IntegerHelper.getInt(data[12], data[13]);
            ranges    = new Range[numRanges];

            int pos = 14;

            for (int i = 0; i < numRanges; i++)
            {
                ranges[i]             = new Range();
                ranges[i].firstRow    = IntegerHelper.getInt(data[pos], data[pos + 1]);
                ranges[i].lastRow     = IntegerHelper.getInt(data[pos + 2], data[pos + 3]);
                ranges[i].firstColumn = IntegerHelper.getInt(data[pos + 4], data[pos + 5]);
                ranges[i].lastColumn  = IntegerHelper.getInt(data[pos + 6], data[pos + 7]);
                pos += 8;
            }

            initialized = true;
        }
コード例 #18
0
ファイル: WritableRecordData.cs プロジェクト: morninn/PetSof
        /**
         * The number of bytes for this record exceeds the maximum record
         * length, so a continue is required
         * @param data the raw data
         * @return  the continued data
         */
        private byte[] handleContinueRecords(byte[] data)
        {
            // Deduce the number of continue records
            int continuedData      = data.Length - (maxRecordLength - 4);
            int numContinueRecords = continuedData / (maxRecordLength - 4) + 1;

            // Create the new byte array, allowing for the continue records
            // code and length
            byte[] newdata = new byte[data.Length + numContinueRecords * 4];

            // Copy the bona fide record data into the beginning of the super
            // record
            System.Array.Copy(data, 0, newdata, 0, maxRecordLength - 4);
            int oldarraypos = maxRecordLength - 4;
            int newarraypos = maxRecordLength - 4;

            // Now handle all the continue records
            for (int i = 0; i < numContinueRecords; i++)
            {
                // The number of bytes to add into the new array
                int length = System.Math.Min(data.Length - oldarraypos, maxRecordLength - 4);

                // Add in the continue record code
                IntegerHelper.getTwoBytes(Type.CONTINUE.value, newdata, newarraypos);
                IntegerHelper.getTwoBytes(length, newdata, newarraypos + 2);

                // Copy in as much of the new data as possible
                System.Array.Copy(data, oldarraypos, newdata, newarraypos + 4, length);

                // Update the position counters
                oldarraypos += length;
                newarraypos += length + 4;
            }

            return(newdata);
        }
コード例 #19
0
ファイル: DVParser.cs プロジェクト: ferrinsp/kbellfireapp
        /**
         * Gets the data
         */
        public virtual byte[] getData()
        {
            // Compute the length of the data
            byte[] f1Bytes = formula1 != null?formula1.getBytes() : new byte[0];

            byte[] f2Bytes = formula2 != null?formula2.getBytes() : new byte[0];

            int dataLength = 4 +                          // the options
                             promptTitle.Length * 2 + 3 + // the prompt title
                             errorTitle.Length * 2 + 3 +  // the error title
                             promptText.Length * 2 + 3 +  // the prompt text
                             errorText.Length * 2 + 3 +   // the error text
                             f1Bytes.Length + 2 +         // first formula
                             f2Bytes.Length + 2 +         // second formula
                             +4 +                         // unused bytes
                             10;                          // cell range

            byte[] data = new byte[dataLength];

            // The position
            int pos = 0;

            // The options
            int options = 0;

            options |= type.getValue();
            options |= errorStyle.getValue() << 4;
            options |= condition.getValue() << 20;

            if (stringListGiven)
            {
                options |= STRING_LIST_GIVEN_MASK;
            }

            if (emptyCellsAllowed)
            {
                options |= EMPTY_CELLS_ALLOWED_MASK;
            }

            if (suppressArrow)
            {
                options |= SUPPRESS_ARROW_MASK;
            }

            if (showPrompt)
            {
                options |= SHOW_PROMPT_MASK;
            }

            if (showError)
            {
                options |= SHOW_ERROR_MASK;
            }

            // The text
            IntegerHelper.getFourBytes(options, data, pos);
            pos += 4;

            IntegerHelper.getTwoBytes(promptTitle.Length, data, pos);
            pos += 2;

            data[pos] = (byte)0x1;             // unicode indicator
            pos++;

            StringHelper.getUnicodeBytes(promptTitle, data, pos);
            pos += promptTitle.Length * 2;

            IntegerHelper.getTwoBytes(errorTitle.Length, data, pos);
            pos += 2;

            data[pos] = (byte)0x1;             // unicode indicator
            pos++;

            StringHelper.getUnicodeBytes(errorTitle, data, pos);
            pos += errorTitle.Length * 2;

            IntegerHelper.getTwoBytes(promptText.Length, data, pos);
            pos += 2;

            data[pos] = (byte)0x1;             // unicode indicator
            pos++;

            StringHelper.getUnicodeBytes(promptText, data, pos);
            pos += promptText.Length * 2;

            IntegerHelper.getTwoBytes(errorText.Length, data, pos);
            pos += 2;

            data[pos] = (byte)0x1;             // unicode indicator
            pos++;

            StringHelper.getUnicodeBytes(errorText, data, pos);
            pos += errorText.Length * 2;

            // Formula 1
            IntegerHelper.getTwoBytes(f1Bytes.Length, data, pos);
            pos += 4;

            System.Array.Copy(f1Bytes, 0, data, pos, f1Bytes.Length);
            pos += f1Bytes.Length;

            // Formula 2
            IntegerHelper.getTwoBytes(f2Bytes.Length, data, pos);
            pos += 4;

            System.Array.Copy(f2Bytes, 0, data, pos, f2Bytes.Length);
            pos += f2Bytes.Length;

            // The cell ranges
            IntegerHelper.getTwoBytes(1, data, pos);
            pos += 2;

            IntegerHelper.getTwoBytes(row1, data, pos);
            pos += 2;

            IntegerHelper.getTwoBytes(row2, data, pos);
            pos += 2;

            IntegerHelper.getTwoBytes(column1, data, pos);
            pos += 2;

            IntegerHelper.getTwoBytes(column2, data, pos);
            pos += 2;

            return(data);
        }
コード例 #20
0
ファイル: DVParser.cs プロジェクト: ferrinsp/kbellfireapp
        /**
         * Constructor
         */
        public DVParser(byte[] data,
                        ExternalSheet es,
                        WorkbookMethods nt,
                        WorkbookSettings ws)
        {
            Assert.verify(nt != null);

            wasCopied = false;
            int options = IntegerHelper.getInt(data[0], data[1], data[2], data[3]);

            int typeVal = options & 0xf;

            type = DVType.getType(typeVal);

            int errorStyleVal = (options & 0x70) >> 4;

            errorStyle = ErrorStyle.getErrorStyle(errorStyleVal);

            int conditionVal = (options & 0xf00000) >> 20;

            condition = Condition.getCondition(conditionVal);

            stringListGiven   = (options & STRING_LIST_GIVEN_MASK) != 0;
            emptyCellsAllowed = (options & EMPTY_CELLS_ALLOWED_MASK) != 0;
            suppressArrow     = (options & SUPPRESS_ARROW_MASK) != 0;
            showPrompt        = (options & SHOW_PROMPT_MASK) != 0;
            showError         = (options & SHOW_ERROR_MASK) != 0;

            int pos    = 4;
            int length = IntegerHelper.getInt(data[pos], data[pos + 1]);

            if (length > 0 && data[pos + 2] == 0)
            {
                promptTitle = StringHelper.getString(data, length, pos + 3, ws);
                pos        += length + 3;
            }
            else if (length > 0)
            {
                promptTitle = StringHelper.getUnicodeString(data, length, pos + 3);
                pos        += length * 2 + 3;
            }
            else
            {
                pos += 3;
            }

            length = IntegerHelper.getInt(data[pos], data[pos + 1]);
            if (length > 0 && data[pos + 2] == 0)
            {
                errorTitle = StringHelper.getString(data, length, pos + 3, ws);
                pos       += length + 3;
            }
            else if (length > 0)
            {
                errorTitle = StringHelper.getUnicodeString(data, length, pos + 3);
                pos       += length * 2 + 3;
            }
            else
            {
                pos += 3;
            }

            length = IntegerHelper.getInt(data[pos], data[pos + 1]);
            if (length > 0 && data[pos + 2] == 0)
            {
                promptText = StringHelper.getString(data, length, pos + 3, ws);
                pos       += length + 3;
            }
            else if (length > 0)
            {
                promptText = StringHelper.getUnicodeString(data, length, pos + 3);
                pos       += length * 2 + 3;
            }
            else
            {
                pos += 3;
            }

            length = IntegerHelper.getInt(data[pos], data[pos + 1]);
            if (length > 0 && data[pos + 2] == 0)
            {
                errorText = StringHelper.getString(data, length, pos + 3, ws);
                pos      += length + 3;
            }
            else if (length > 0)
            {
                errorText = StringHelper.getUnicodeString(data, length, pos + 3);
                pos      += length * 2 + 3;
            }
            else
            {
                pos += 3;
            }

            int formula1Length = IntegerHelper.getInt(data[pos], data[pos + 1]);

            pos += 4;
            int formula1Pos = pos;

            pos += formula1Length;

            int formula2Length = IntegerHelper.getInt(data[pos], data[pos + 1]);

            pos += 4;
            int formula2Pos = pos;

            pos += formula2Length;

            pos += 2;

            row1 = IntegerHelper.getInt(data[pos], data[pos + 1]);
            pos += 2;

            row2 = IntegerHelper.getInt(data[pos], data[pos + 1]);
            pos += 2;

            column1 = IntegerHelper.getInt(data[pos], data[pos + 1]);
            pos    += 2;

            column2 = IntegerHelper.getInt(data[pos], data[pos + 1]);
            pos    += 2;

            hasExtendedCellsValidation = (row1 == row2 && column1 == column2) ? false : true;

            // Do the formulas
            try
            {
                // First, create a temporary  blank cell for any formula relative
                // references
                EmptyCell tmprt = new EmptyCell(column1, row1);

                if (formula1Length != 0)
                {
                    byte[] tokens = new byte[formula1Length];
                    System.Array.Copy(data, formula1Pos, tokens, 0, formula1Length);
                    formula1 = new FormulaParser(tokens, tmprt, es, nt, ws,
                                                 ParseContext.DATA_VALIDATION);
                    formula1.parse();
                }

                if (formula2Length != 0)
                {
                    byte[] tokens = new byte[formula2Length];
                    System.Array.Copy(data, formula2Pos, tokens, 0, formula2Length);
                    formula2 = new FormulaParser(tokens, tmprt, es, nt, ws,
                                                 ParseContext.DATA_VALIDATION);
                    formula2.parse();
                }
            }
            catch (FormulaException e)
            {
                //logger.warn(e.Message + " for cells " +
                //    CellReferenceHelper.getCellReference(column1,row1) + "-" +
                //    CellReferenceHelper.getCellReference(column2,row2));
            }
        }
コード例 #21
0
ファイル: BaseCompoundFile.cs プロジェクト: morninn/PetSof
 /**
  * Sets the child
  *
  * @param dir the child
  */
 public void setChild(int dir)
 {
     child = dir;
     IntegerHelper.getFourBytes(child, data, CHILD_POS);
 }
コード例 #22
0
ファイル: BaseCompoundFile.cs プロジェクト: morninn/PetSof
 /**
  * Sets the size of the file
  *
  * @param s the size
  */
 public void setSize(int s)
 {
     size = s;
     IntegerHelper.getFourBytes(s, data, SIZE_POS);
 }
コード例 #23
0
ファイル: BaseCompoundFile.cs プロジェクト: morninn/PetSof
 /**
  * Sets the previous block
  *
  * @param prev the previous block
  */
 public void setPrevious(int prev)
 {
     previous = prev;
     IntegerHelper.getFourBytes(prev, data, PREVIOUS_POS);
 }
コード例 #24
0
ファイル: BaseCompoundFile.cs プロジェクト: morninn/PetSof
 /**
  * Sets the number of the start block
  *
  * @param sb the number of the start block
  */
 public void setStartBlock(int sb)
 {
     startBlock = sb;
     IntegerHelper.getFourBytes(sb, data, START_BLOCK_POS);
 }
コード例 #25
0
ファイル: BaseCompoundFile.cs プロジェクト: morninn/PetSof
 /**
  * Sets the next block
  *
  * @param nxt the next block
  */
 public void setNext(int nxt)
 {
     next = nxt;
     IntegerHelper.getFourBytes(next, data, NEXT_POS);
 }