コード例 #1
0
ファイル: LabelRecord.cs プロジェクト: wondaz/hello-world
        /**
         * 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 = "";
            }
        }
コード例 #2
0
ファイル: FeatRecord.cs プロジェクト: wondaz/hello-world
        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;
            }
        }
コード例 #3
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);
            }
        }