Exemple #1
0
        /**
         * Constructs a Font record and Sets its fields appropriately.
         *
         * @param in the RecordInputstream to Read the record from
         */

        public FontRecord(RecordInputStream in1)
        {
            field_1_font_height = in1.ReadShort();
            field_2_attributes = in1.ReadShort();
            field_3_color_palette_index = in1.ReadShort();
            field_4_bold_weight = in1.ReadShort();
            field_5_base_sub_script = in1.ReadShort();
            field_6_underline = (byte)in1.ReadByte();
            field_7_family = (byte)in1.ReadByte();
            field_8_charset = (byte)in1.ReadByte();
            field_9_zero = (byte)in1.ReadByte();
            int field_10_font_name_len = (byte)in1.ReadByte();
            int unicodeFlags = in1.ReadUByte(); // options byte present always (even if no character data)

            if (field_10_font_name_len > 0)
            {
                if (unicodeFlags == 0)
                {   // Is compressed Unicode
                    field_11_font_name = in1.ReadCompressedUnicode(field_10_font_name_len);
                }
                else
                {   // Is not compressed Unicode
                    field_11_font_name = in1.ReadUnicodeLEString(field_10_font_name_len);
                }
            }
            else
            {
                field_11_font_name = "";
            }
        }
        /**
         * Constructs a Style record and Sets its fields appropriately.
         * @param in the RecordInputstream to Read the record from
         */

        public StyleRecord(RecordInputStream in1)
        {
            fHighByte = BitFieldFactory.GetInstance(0x01); //have to init here, since we are being called
            //from base, and class level init hasnt been done. 
            field_1_xf_index = in1.ReadShort();
            if (Type == STYLE_BUILT_IN)
            {
                field_2_builtin_style = (byte)in1.ReadByte();
                field_3_outline_style_level = (byte)in1.ReadByte();
            }
            else if (Type == STYLE_USER_DEFINED)
            {
                field_2_name_length = in1.ReadShort();

                // Some files from Crystal Reports lack
                //  the remaining fields, which Is naughty
                if (in1.Remaining > 0)
                {
                    field_3_string_options = (byte)in1.ReadByte();

                    byte[] str = in1.ReadRemainder();
                    if (fHighByte.IsSet(field_3_string_options))
                    {
                        field_4_name = StringUtil.GetFromUnicodeBE(str, 0, field_2_name_length);
                    }
                    else
                    {
                        field_4_name = StringUtil.GetFromCompressedUnicode(str, 0, field_2_name_length);
                    }
                }
            }

            // todo sanity Check exception to make sure we're one or the other
        }
        /**
         * Constructs a SeriesText record and Sets its fields appropriately.
         *
         * @param in the RecordInputstream to Read the record from
         */

        public SeriesTextRecord(RecordInputStream in1)
        {

            field_1_id = in1.ReadShort();
            field_2_textLength = (byte)in1.ReadByte();
            field_3_undocumented = (byte)in1.ReadByte();
            field_4_text = in1.ReadUnicodeLEString(field_2_textLength);
        }
 public CRNRecord(RecordInputStream in1)
 {
     field_1_last_column_index = in1.ReadByte() & 0x00FF;
     field_2_first_column_index = in1.ReadByte() & 0x00FF;
     field_3_row_index = in1.ReadShort();
     int nValues = field_1_last_column_index - field_2_first_column_index + 1;
     field_4_constant_values = ConstantValueParser.Parse(in1, nValues);
 }
        /**
         * Constructs a BoolErr record and Sets its fields appropriately.
         *
         * @param in the RecordInputstream to Read the record from
         */

        public BoolErrRecord(RecordInputStream in1)
        {
            field_1_row = in1.ReadUShort();
            field_2_column = in1.ReadUShort();
            field_3_xf_index = in1.ReadShort();
            field_4_bBoolErr = (byte)in1.ReadByte();
            field_5_fError = (byte)in1.ReadByte();
        }
Exemple #6
0
        /**
         * Constructs a MMS record and Sets its fields appropriately.
         * @param in the RecordInputstream to Read the record from
         */

        public MMSRecord(RecordInputStream in1)
        {
            if (in1.Remaining == 0)
            {
                return;
            }
            field_1_AddMenuCount = (byte)in1.ReadByte();
            field_2_delMenuCount = (byte)in1.ReadByte();
        }
Exemple #7
0
 public TableRecord(RecordInputStream in1)
     : base(in1)
 {
     field_5_flags = in1.ReadByte();
     field_6_res = in1.ReadByte();
     field_7_rowInputRow = in1.ReadShort();
     field_8_colInputRow = in1.ReadShort();
     field_9_rowInputCol = in1.ReadShort();
     field_10_colInputCol = in1.ReadShort();
 }
        /**
         * Constructs a Legend record and Sets its fields appropriately.
         *
         * @param in the RecordInputstream to Read the record from
         */

        public LegendRecord(RecordInputStream in1)
        {
            field_1_xAxisUpperLeft = in1.ReadInt();
            field_2_yAxisUpperLeft = in1.ReadInt();
            field_3_xSize = in1.ReadInt();
            field_4_ySize = in1.ReadInt();
            field_5_type = (byte)in1.ReadByte();
            field_6_spacing = (byte)in1.ReadByte();
            field_7_options = in1.ReadShort();

        }
        public ChartFRTInfoRecord(RecordInputStream in1)
        {
            rt = in1.ReadShort();
            grbitFrt = in1.ReadShort();
            verOriginator = (byte)in1.ReadByte();
            verWriter = (byte)in1.ReadByte();
            int cCFRTID = in1.ReadShort();

            rgCFRTID = new CFRTID[cCFRTID];
            for (int i = 0; i < cCFRTID; i++)
            {
                rgCFRTID[i] = new CFRTID(in1);
            }
        }
Exemple #10
0
        /**
         * Constructs a Tick record and Sets its fields appropriately.
         *
         * @param in the RecordInputstream to Read the record from
         */
        public TickRecord(RecordInputStream in1)
        {
            field_1_majorTickType = (byte)in1.ReadByte();
            field_2_minorTickType = (byte)in1.ReadByte();
            field_3_labelPosition = (byte)in1.ReadByte();
            field_4_background = (byte)in1.ReadByte();
            field_5_labelColorRgb = (byte)in1.ReadInt();
            field_6_zero1 = in1.ReadInt();
            field_7_zero2 = in1.ReadInt();
            field_8_zero3 = in1.ReadInt();
            field_9_zero4 = in1.ReadInt();

            field_10_options = in1.ReadShort();
            field_11_tickColor = in1.ReadShort();
            field_12_zero5 = in1.ReadShort();
        }
Exemple #11
0
        /**
         * Constructs an Label record and Sets its fields appropriately.
         *
         * @param in the RecordInputstream to Read the record from
         */

        public LabelRecord(RecordInputStream in1)
        {
            field_1_row = in1.ReadUShort();
            field_2_column = in1.ReadUShort();
            field_3_xf_index = in1.ReadShort();
            field_4_string_len = in1.ReadShort();
            field_5_unicode_flag = (byte)in1.ReadByte();
            if (field_4_string_len > 0)
            {
                if (IsUncompressedUnicode)
                {
                    field_6_value = in1.ReadUnicodeLEString(field_4_string_len);
                }
                else
                {
                    field_6_value = in1.ReadCompressedUnicode(field_4_string_len);
                }
            }
            else
            {
                field_6_value = "";
            }
            if (in1.Remaining > 0)
            {
                logger.Log(POILogger.INFO, "LabelRecord data remains: " +in1.Remaining +
                " : " + HexDump.ToHex(in1.ReadRemainder()));
            }
        }
Exemple #12
0
        public FeatRecord(RecordInputStream in1)
        {
            futureHeader = new FtrHeader(in1);

            isf_sharedFeatureType = in1.ReadShort();
            reserved1 = (byte)in1.ReadByte();
            reserved2 = in1.ReadInt();
            int cref = in1.ReadUShort();
            cbFeatData = in1.ReadInt();
            reserved3 = in1.ReadShort();

            cellRefs = new CellRangeAddress[cref];
            for (int i = 0; i < cellRefs.Length; i++)
            {
                cellRefs[i] = new CellRangeAddress(in1);
            }

            switch (isf_sharedFeatureType)
            {
                case FeatHdrRecord.SHAREDFEATURES_ISFPROTECTION:
                    sharedFeature = new FeatProtection(in1);
                    break;
                case FeatHdrRecord.SHAREDFEATURES_ISFFEC2:
                    sharedFeature = new FeatFormulaErr2(in1);
                    break;
                case FeatHdrRecord.SHAREDFEATURES_ISFFACTOID:
                    sharedFeature = new FeatSmartTag(in1);
                    break;
                default:
                    System.Console.WriteLine("Unknown Shared Feature " + isf_sharedFeatureType + " found!");
                    break;
            }
        }
Exemple #13
0
        /**
         * Constructs a ColumnInfo record and Sets its fields appropriately
         * @param in the RecordInputstream to Read the record from
         */

        public ColumnInfoRecord(RecordInputStream in1)
        {
            _first_col = in1.ReadUShort();
            _last_col = in1.ReadUShort();
            _col_width = in1.ReadUShort();
            _xf_index = in1.ReadUShort();
            _options = in1.ReadUShort();
            switch (in1.Remaining)
            {
                case 2: // usual case
                    field_6_reserved = in1.ReadUShort();
                    break;
                case 1:
                    // often COLINFO Gets encoded 1 byte short
                    // shouldn't matter because this field Is Unused
                    field_6_reserved = in1.ReadByte();
                    break;
                case 0:
                    // According to bugzilla 48332,
                    // "SoftArtisans OfficeWriter for Excel" totally skips field 6
                    // Excel seems to be OK with this, and assumes zero.
                    field_6_reserved = 0;
                    break;
                default:
                    throw new Exception("Unusual record size remaining=(" + in1.Remaining + ")");
            }
        }
        /**
         * Constructs a BoolErr record and Sets its fields appropriately.
         *
         * @param in the RecordInputstream to Read the record from
         */

        public BoolErrRecord(RecordInputStream in1)
            : base(in1)
        {
            switch (in1.Remaining)
            {
                case 2:
                    _value = in1.ReadByte();
                    break;
                case 3:
                    _value = in1.ReadUShort();
                    break;
                default:
                    throw new RecordFormatException("Unexpected size ("
                            + in1.Remaining + ") for BOOLERR record.");
            }
            int flag = in1.ReadUByte();
            switch (flag)
            {
                case 0:
                    _isError = false;
                    break;
                case 1:
                    _isError = true;
                    break;
                default:
                    throw new RecordFormatException("Unexpected isError flag ("
                            + flag + ") for BOOLERR record.");
            }
        }
        /**
         * Constructs a FileSharing record and Sets its fields appropriately.
         * @param in the RecordInputstream to Read the record from
         */

        public FileSharingRecord(RecordInputStream in1)
        {
            field_1_Readonly = in1.ReadShort();
            field_2_password = in1.ReadShort();

            int nameLen = in1.ReadShort();

            if (nameLen > 0)
            {
                // TODO - Current examples(3) from junits only have zero Length username. 
                field_3_username_unicode_options = (byte)in1.ReadByte();
                field_3_username_value = in1.ReadCompressedUnicode(nameLen);
                
                if (field_3_username_value == null)
                {
                   // In some cases the user name can be null after reading from
                   // the input stream so we make sure this has a value
                   field_3_username_value = "";
                }
            }
            else
            {
                field_3_username_value = "";
            }
        }
Exemple #16
0
 public ArrayPtg(RecordInputStream in1)
 {
     field_1_reserved = new byte[RESERVED_FIELD_LEN];
     // TODO - Add ReadFully method to RecordInputStream
     for (int i = 0; i < RESERVED_FIELD_LEN; i++)
     {
         field_1_reserved[i] = (byte)in1.ReadByte();
     }
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="FooterRecord"/> class.
        /// </summary>
        /// <param name="in1">the RecordInputstream to Read the record from</param>
        public FooterRecord(RecordInputStream in1)
        {
            if (in1.Remaining > 0)
            {
                field_1_footer_len = (byte)in1.ReadByte();
                /** These two fields are a bit odd. They are not documented*/
                field_2_reserved = (byte)in1.ReadByte();
                field_3_unicode_flag = (byte)in1.ReadByte();						// Unicode

                if (IsMultibyte)
                {
                    field_4_footer = in1.ReadUnicodeLEString(LittleEndian.UByteToInt(field_1_footer_len));
                }
                else
                {
                    field_4_footer = in1.ReadCompressedUnicode(LittleEndian.UByteToInt(field_1_footer_len));
                }
            }
        }
Exemple #18
0
        /**
         * Constructs a Style record and Sets its fields appropriately.
         * @param in the RecordInputstream to Read the record from
         */

        public StyleRecord(RecordInputStream in1)
        {
            field_1_xf_index = in1.ReadShort();
            if (IsBuiltin)
            {
                field_2_builtin_style = in1.ReadByte();
                field_3_outline_style_level = in1.ReadByte();
            }
            else
            {
                int field_2_name_length = in1.ReadShort();

                // Some files from Crystal Reports lack
                //  the remaining fields, which Is naughty
                if (in1.Remaining <1)
                {
                    // Some files from Crystal Reports lack the is16BitUnicode byte
                    //  the remaining fields, which is naughty
                    if (field_2_name_length != 0)
                    {
                        throw new RecordFormatException("Ran out of data reading style record");
                    }
                    // guess this is OK if the string length is zero
                    field_4_name = "";
                }
                else
                {
				    field_3_stringHasMultibyte = in1.ReadByte() != 0x00;
				    if (field_3_stringHasMultibyte)
                    {
                        field_4_name = StringUtil.ReadUnicodeLE(in1, field_2_name_length);
                    }
                    else
                    {
                        field_4_name = StringUtil.ReadCompressedUnicode(in1,field_2_name_length);
                    }
                }
            }

            // todo sanity Check exception to make sure we're one or the other
        }
Exemple #19
0
        /**
         * Constructs a String record and Sets its fields appropriately.
         *
         * @param in the RecordInputstream to Read the record from
         */
        public StringRecord(RecordInputStream in1)
        {
            int field_1_string_length = in1.ReadShort();
            _is16bitUnicode = in1.ReadByte() != 0x00;

            if (_is16bitUnicode)
            {
                _text = in1.ReadUnicodeLEString(field_1_string_length);
            }
            else
            {
                _text = in1.ReadCompressedUnicode(field_1_string_length);
            }
        }
Exemple #20
0
        /// <summary>
        /// Constructs a Selection record and Sets its fields appropriately.
        /// </summary>
        /// <param name="in1">the RecordInputstream to Read the record from</param>
        public SelectionRecord(RecordInputStream in1)
        {
            field_1_pane = (byte)in1.ReadByte();
            
            field_2_row_active_cell = in1.ReadUShort();
            field_3_col_active_cell = in1.ReadShort();
            field_4_ref_active_cell = in1.ReadShort();
            int field_5_num_refs = in1.ReadUShort();

            field_6_refs = new CellRangeAddress8Bit[field_5_num_refs];
            for (int i = 0; i < field_5_num_refs; i++)
            {
                field_6_refs[i] = new CellRangeAddress8Bit(in1);
            }
        }
Exemple #21
0
 /**
  * Constructs a String record and Sets its fields appropriately.
  *
  * @param in the RecordInputstream to Read the record from
  */
 public StringRecord(RecordInputStream in1)
 {
     int field_1_string_Length = in1.ReadShort();
     field_2_unicode_flag = in1.ReadByte() != 0x00;
     byte[] data = in1.ReadRemainder();
     //Why Isnt this using the in1.ReadString methods???
     if (field_2_unicode_flag)
     {
         field_3_string = StringUtil.GetFromUnicodeLE(data, 0, field_1_string_Length);
     }
     else
     {
         field_3_string = StringUtil.GetFromCompressedUnicode(data, 0, field_1_string_Length);
     }
 }
Exemple #22
0
        /** Create a StringPtg from a stream */
        public StringPtg(RecordInputStream in1)
        {
            field_1_Length = in1.ReadUByte();
            field_2_options = (byte)in1.ReadByte();
            if (fHighByte.IsSet(field_2_options))
            {
                field_3_string = in1.ReadUnicodeLEString(field_1_Length);
            }
            else
            {
                field_3_string = in1.ReadCompressedUnicode(field_1_Length);
            }

            // SetValue(new String(data, offset+3, data[offset+1] + 256*data[offset+2]));
        }
Exemple #23
0
        /**
         * Constructs a BoundSheetRecord and Sets its fields appropriately
         *
         * @param in the RecordInputstream to Read the record from
         */
        public BoundSheetRecord(RecordInputStream in1)
        {
            field_1_position_of_BOF = in1.ReadInt();	// bof
            field_2_option_flags = in1.ReadShort();	// flags
            int field_3_sheetname_length = in1.ReadUByte();						// len(str)
            field_4_isMultibyteUnicode = (byte)in1.ReadByte();						// Unicode

            if (this.IsMultibyte)
            {
                field_5_sheetname = in1.ReadUnicodeLEString(field_3_sheetname_length);
            }
            else
            {
                field_5_sheetname = in1.ReadCompressedUnicode(field_3_sheetname_length);
            }
        }
Exemple #24
0
        /**
         * Constructs a Format record and Sets its fields appropriately.
         * @param in the RecordInputstream to Read the record from
         */

        public FormatRecord(RecordInputStream in1)
        {
            field_1_index_code = in1.ReadShort();
            int field_3_unicode_len = in1.ReadShort();
            field_3_hasMultibyte = (in1.ReadByte() & (byte)0x01) != 0;

            if (field_3_hasMultibyte)
            {
                // Unicode
                field_4_formatstring = in1.ReadUnicodeLEString(field_3_unicode_len);
            }
            else
            {
                // not Unicode
                field_4_formatstring = in1.ReadCompressedUnicode(field_3_unicode_len);
            }
        }
Exemple #25
0
        /**
         * Constructs a <c>NoteRecord</c> and Fills its fields
         * from the supplied <c>RecordInputStream</c>.
         *
         * @param in the stream to Read from
         */
        public NoteRecord(RecordInputStream in1)
        {
            field_1_row = in1.ReadShort();
            field_2_col = in1.ReadUShort();
            field_3_flags = in1.ReadShort();
            field_4_shapeid = in1.ReadUShort();
            int length = in1.ReadShort();
		    field_5_hasMultibyte = in1.ReadByte() != 0x00;
		    if (field_5_hasMultibyte) {
			    field_6_author = StringUtil.ReadUnicodeLE(in1, length);
		    } else {
			    field_6_author = StringUtil.ReadCompressedUnicode(in1, length);
		    }
 		    if (in1.Available() == 1) {
			    field_7_padding = (byte)in1.ReadByte();
		    }
        }
Exemple #26
0
 /**Creates new function pointer from a byte array
  * usually called while Reading an excel file.
  */
 public FuncVarPtg(RecordInputStream in1)
 {
     field_1_num_args = (byte)in1.ReadByte();
     field_2_fnc_index = in1.ReadShort();
     FunctionMetadata fm = FunctionMetadataRegistry.GetFunctionByIndex(field_2_fnc_index);
     if (fm == null)
     {
         // Happens only as a result of a call to FormulaParser.Parse(), with a non-built-in function name
         returnClass = Ptg.CLASS_VALUE;
         paramClass = new byte[] { Ptg.CLASS_VALUE };
     }
     else
     {
         returnClass = fm.ReturnClassCode;
         paramClass = fm.ParameterClassCodes;
     }
 }
        /**
         * Constructs a FileSharing record and Sets its fields appropriately.
         * @param in the RecordInputstream to Read the record from
         */

        public FileSharingRecord(RecordInputStream in1)
        {
            field_1_Readonly = in1.ReadShort();
            field_2_password = in1.ReadShort();

            int nameLen = in1.ReadShort();

            if (nameLen > 0)
            {
                // TODO - Current examples(3) from junits only have zero Length username. 
                field_3_username_unicode_options = (byte)in1.ReadByte();
                field_3_username_value = in1.ReadCompressedUnicode(nameLen);
            }
            else
            {
                field_3_username_value = "";
            }
        }
Exemple #28
0
        public ViewFieldsRecord(RecordInputStream in1)
        {
            sxaxis = in1.ReadShort();
            cSub = in1.ReadShort();
            grbitSub = in1.ReadShort();
            cItm = in1.ReadShort();

            int cchName = in1.ReadUShort();
            if (cchName != STRING_NOT_PRESENT_LEN)
            {
                int flag = in1.ReadByte();
                if ((flag & 0x01) != 0)
                {
                    _name = in1.ReadUnicodeLEString(cchName);
                }
                else
                {
                    _name = in1.ReadCompressedUnicode(cchName);
                }
            }
        }
Exemple #29
0
 /**
  * Constructs a ColumnInfo record and Sets its fields appropriately
  * @param in the RecordInputstream to Read the record from
  */
 public ColumnInfoRecord(RecordInputStream in1)
 {
     field_1_first_col = in1.ReadUShort();
     field_2_last_col = in1.ReadUShort();
     field_3_col_width = in1.ReadShort();
     field_4_xf_index = in1.ReadShort();
     field_5_options = in1.ReadShort();
     switch (in1.Remaining)
     {
         case 2: // usual case
             field_6_reserved = in1.ReadShort();
             break;
         case 1:
             // often COLINFO Gets encoded 1 byte short
             // shouldn't matter because this field Is Unused
             field_6_reserved = in1.ReadByte();
             break;
         default:
             throw new Exception("Unusual record size remaining=(" + in1.Remaining + ")");
     }
 }
Exemple #30
0
        /**
         * Constructs an Label record and Sets its fields appropriately.
         *
         * @param in the RecordInputstream to Read the record from
         */

        public LabelRecord(RecordInputStream in1)
        {
            field_1_row = in1.ReadUShort();
            field_2_column = in1.ReadUShort();
            field_3_xf_index = in1.ReadShort();
            field_4_string_len = in1.ReadShort();
            field_5_unicode_flag = (byte)in1.ReadByte();
            if (field_4_string_len > 0)
            {
                if (IsUnCompressedUnicode)
                {
                    field_6_value = in1.ReadUnicodeLEString(field_4_string_len);
                }
                else
                {
                    field_6_value = in1.ReadCompressedUnicode(field_4_string_len);
                }
            }
            else
            {
                field_6_value = "";
            }
        }
Exemple #31
0
        /**
         * Constructs an Label record and Sets its fields appropriately.
         *
         * @param in the RecordInputstream to Read the record from
         */

        public LabelRecord(RecordInputStream in1)
        {
            field_1_row          = in1.ReadUShort();
            field_2_column       = in1.ReadUShort();
            field_3_xf_index     = in1.ReadShort();
            field_4_string_len   = in1.ReadShort();
            field_5_unicode_flag = (byte)in1.ReadByte();
            if (field_4_string_len > 0)
            {
                if (IsUncompressedUnicode)
                {
                    field_6_value = in1.ReadUnicodeLEString(field_4_string_len);
                }
                else
                {
                    field_6_value = in1.ReadCompressedUnicode(field_4_string_len);
                }
            }
            else
            {
                field_6_value = "";
            }
        }
        protected HeaderFooterBase(RecordInputStream in1)
        {
            if (in1.Remaining > 0)
            {
                int field_1_footer_len = in1.ReadShort();
                field_2_hasMultibyte = in1.ReadByte() != 0x00;

                if (field_2_hasMultibyte)
                {
                    field_3_text = in1.ReadUnicodeLEString(field_1_footer_len);
                }
                else
                {
                    field_3_text = in1.ReadCompressedUnicode(field_1_footer_len);
                }
            }
            else
            {
                // Note - this is unusual for BIFF records in general, but normal for header / footer records:
                // when the text is empty string, the whole record is empty (just the 4 byte BIFF header)
                field_3_text = "";
            }
        }
Exemple #33
0
        public FeatRecord(RecordInputStream in1)
        {
            futureHeader = new FtrHeader(in1);

            isf_sharedFeatureType = in1.ReadShort();
            reserved1             = (byte)in1.ReadByte();
            reserved2             = in1.ReadInt();
            int cref = in1.ReadUShort();

            cbFeatData = in1.ReadInt();
            reserved3  = in1.ReadShort();

            cellRefs = new CellRangeAddress[cref];
            for (int i = 0; i < cellRefs.Length; i++)
            {
                cellRefs[i] = new CellRangeAddress(in1);
            }

            switch (isf_sharedFeatureType)
            {
            case FeatHdrRecord.SHAREDFEATURES_ISFPROTECTION:
                sharedFeature = new FeatProtection(in1);
                break;

            case FeatHdrRecord.SHAREDFEATURES_ISFFEC2:
                sharedFeature = new FeatFormulaErr2(in1);
                break;

            case FeatHdrRecord.SHAREDFEATURES_ISFFACTOID:
                sharedFeature = new FeatSmartTag(in1);
                break;

            default:
                logger.Log(POILogger.ERROR, "Unknown Shared Feature " + isf_sharedFeatureType + " found!");
                break;
            }
        }
Exemple #34
0
        /**
         * Constructs a Font record and Sets its fields appropriately.
         *
         * @param in the RecordInputstream to Read the record from
         */

        public FontRecord(RecordInputStream in1)
        {
            field_1_font_height         = in1.ReadShort();
            field_2_attributes          = in1.ReadShort();
            field_3_color_palette_index = in1.ReadShort();
            field_4_bold_weight         = in1.ReadShort();
            field_5_base_sub_script     = in1.ReadShort();
            field_6_underline           = (byte)in1.ReadByte();
            field_7_family         = (byte)in1.ReadByte();
            field_8_charset        = (byte)in1.ReadByte();
            field_9_zero           = (byte)in1.ReadByte();
            field_10_font_name_len = (byte)in1.ReadByte();
            if (field_10_font_name_len > 0)
            {
                if (in1.ReadByte() == 0)
                {   // Is compressed Unicode
                    field_11_font_name = in1.ReadCompressedUnicode(LittleEndian.UByteToInt(field_10_font_name_len));
                }
                else
                {   // Is not compressed Unicode
                    field_11_font_name = in1.ReadUnicodeLEString(field_10_font_name_len);
                }
            }
        }
Exemple #35
0
        public CFRule12Record(RecordInputStream in1)
        {
            futureHeader        = new FtrHeader(in1);
            ConditionType       = ((byte)in1.ReadByte());
            ComparisonOperation = ((byte)in1.ReadByte());
            int field_3_formula1_len = in1.ReadUShort();
            int field_4_formula2_len = in1.ReadUShort();

            ext_formatting_length = in1.ReadInt();
            ext_formatting_data   = new byte[0];
            if (ext_formatting_length == 0)
            {
                // 2 bytes reserved
                in1.ReadUShort();
            }
            else
            {
                int len = ReadFormatOptions(in1);
                if (len < ext_formatting_length)
                {
                    ext_formatting_data = new byte[ext_formatting_length - len];
                    in1.ReadFully(ext_formatting_data);
                }
            }

            Formula1 = (Formula.Read(field_3_formula1_len, in1));
            Formula2 = (Formula.Read(field_4_formula2_len, in1));

            int formula_scale_len = in1.ReadUShort();

            formula_scale = Formula.Read(formula_scale_len, in1);

            ext_opts              = (byte)in1.ReadByte();
            priority              = in1.ReadUShort();
            template_type         = in1.ReadUShort();
            template_param_length = (byte)in1.ReadByte();
            if (template_param_length == 0 || template_param_length == 16)
            {
                template_params = new byte[template_param_length];
                in1.ReadFully(template_params);
            }
            else
            {
                //logger.Log(POILogger.WARN, "CF Rule v12 template params length should be 0 or 16, found " + template_param_length);
                in1.ReadRemainder();
            }

            byte type = ConditionType;

            if (type == CONDITION_TYPE_COLOR_SCALE)
            {
                color_gradient = new ColorGradientFormatting(in1);
            }
            else if (type == CONDITION_TYPE_DATA_BAR)
            {
                data_bar = new DataBarFormatting(in1);
            }
            else if (type == CONDITION_TYPE_FILTER)
            {
                filter_data = in1.ReadRemainder();
            }
            else if (type == CONDITION_TYPE_ICON_SET)
            {
                multistate = new IconMultiStateFormatting(in1);
            }
        }
Exemple #36
0
        public TextObjectRecord(RecordInputStream in1)
        {
            field_1_options         = in1.ReadUShort();
            field_2_textOrientation = in1.ReadUShort();
            field_3_reserved4       = in1.ReadUShort();
            field_4_reserved5       = in1.ReadUShort();
            field_5_reserved6       = in1.ReadUShort();
            int field_6_textLength           = in1.ReadUShort();
            int field_7_formattingDataLength = in1.ReadUShort();

            field_8_reserved7 = in1.ReadInt();

            if (in1.Remaining > 0)
            {
                // Text Objects can have simple reference formulas
                // (This bit not mentioned in the MS document)
                if (in1.Remaining < 11)
                {
                    throw new RecordFormatException("Not enough remaining data for a link formula");
                }
                int formulaSize = in1.ReadUShort();
                _unknownPreFormulaInt = in1.ReadInt();
                Ptg[] ptgs = Ptg.ReadTokens(formulaSize, in1);
                if (ptgs.Length != 1)
                {
                    throw new RecordFormatException("Read " + ptgs.Length
                                                    + " tokens but expected exactly 1");
                }
                _linkRefPtg = (OperandPtg)ptgs[0];
                if (in1.Remaining > 0)
                {
                    _unknownPostFormulaByte = (byte)in1.ReadByte();
                }
                else
                {
                    _unknownPostFormulaByte = null;
                }
            }
            else
            {
                _linkRefPtg = null;
            }
            if (in1.Remaining > 0)
            {
                throw new RecordFormatException("Unused " + in1.Remaining + " bytes at end of record");
            }

            String text;

            if (field_6_textLength > 0)
            {
                text = ReadRawString(in1, field_6_textLength);
            }
            else
            {
                text = "";
            }
            _text = new HSSFRichTextString(text);

            if (field_7_formattingDataLength > 0)
            {
                ProcessFontRuns(in1, _text, field_7_formattingDataLength);
            }
        }
Exemple #37
0
        /**
         * Constructs a MMS record and Sets its fields appropriately.
         * @param in the RecordInputstream to Read the record from
         */

        public MMSRecord(RecordInputStream in1)
        {
            field_1_AddMenuCount = (byte)in1.ReadByte();
            field_2_delMenuCount = (byte)in1.ReadByte();
        }