Beispiel #1
0
        /**
         * called by the class that Is responsible for writing this sucker.
         * Subclasses should implement this so that their data Is passed back in a
         * @param offset to begin writing at
         * @param data byte array containing instance data
         * @return number of bytes written
         */
        protected override void Serialize(ContinuableRecordOutput out1)
        {
            int field_7_length_custom_menu = field_14_custom_menu_text.Length;
            int field_8_length_description_text = field_15_description_text.Length;
            int field_9_length_help_topic_text = field_16_help_topic_text.Length;
            int field_10_length_status_bar_text = field_17_status_bar_text.Length;
            //int rawNameSize = NameRawSize;

            // size defined below
            out1.WriteShort(OptionFlag);
            out1.WriteByte(KeyboardShortcut);
            out1.WriteByte(NameTextLength);
            // Note - formula size is not immediately before encoded formula, and does not include any array constant data
            out1.WriteShort(field_13_name_definition.EncodedTokenSize);
            out1.WriteShort(field_5_externSheetIndex_plus1);
            out1.WriteShort(field_6_sheetNumber);
            out1.WriteByte(field_7_length_custom_menu);
            out1.WriteByte(field_8_length_description_text);
            out1.WriteByte(field_9_length_help_topic_text);
            out1.WriteByte(field_10_length_status_bar_text);
            out1.WriteByte(field_11_nameIsMultibyte ? 1 : 0);

            if (IsBuiltInName)
            {
                out1.WriteByte(field_12_built_in_code);
            }
            else
            {
                String nameText = field_12_name_text;
                if (field_11_nameIsMultibyte)
                {
                    StringUtil.PutUnicodeLE(nameText,out1);
                }
                else
                {
                    StringUtil.PutCompressedUnicode(nameText, out1);
                }
            }
            field_13_name_definition.SerializeTokens(out1);
            field_13_name_definition.SerializeArrayConstantData(out1);

            StringUtil.PutCompressedUnicode(CustomMenuText,out1);
            StringUtil.PutCompressedUnicode(DescriptionText, out1);
            StringUtil.PutCompressedUnicode(HelpTopicText, out1);
            StringUtil.PutCompressedUnicode(StatusBarText, out1);
        }
Beispiel #2
0
 protected override void Serialize(ContinuableRecordOutput out1)
 {
     out1.WriteShort(field_1_strings_per_bucket);
     for (int k = 0; k < _sstInfos.Length; k++)
     {
         _sstInfos[k].Serialize(out1);
     }
 }
        private void SerializeTXORecord(ContinuableRecordOutput out1)
        {
            out1.WriteShort(field_1_options);
            out1.WriteShort(field_2_textOrientation);
            out1.WriteShort(field_3_reserved4);
            out1.WriteShort(field_4_reserved5);
            out1.WriteShort(field_5_reserved6);
            out1.WriteShort(_text.Length);
            out1.WriteShort(FormattingDataLength);
            out1.WriteInt(field_8_reserved7);

            if (_linkRefPtg != null)
            {
                int formulaSize = _linkRefPtg.Size;
                out1.WriteShort(formulaSize);
                out1.WriteInt(_unknownPreFormulaInt);
                _linkRefPtg.Write(out1);

                if (_unknownPostFormulaByte != null)
                {
                    out1.WriteByte(Convert.ToByte(_unknownPostFormulaByte, CultureInfo.InvariantCulture));
                }
            }
        }
Beispiel #4
0
 /**
  * called by the class that Is responsible for writing this sucker.
  * Subclasses should implement this so that their data Is passed back in a
  * byte array.
  *
  * @param offset to begin writing at
  * @param data byte array containing instance data
  * @return number of bytes written
  */
 protected override void Serialize(ContinuableRecordOutput out1)
 {
     out1.WriteShort(this._text.Length);
     out1.WriteStringData(this._text);
 }
 private void WriteFormatData(ContinuableRecordOutput out1, IRichTextString str)
 {
     int nRuns = str.NumFormattingRuns;
     for (int i = 0; i < nRuns; i++)
     {
         out1.WriteShort(str.GetIndexOfFormattingRun(i));
         int fontIndex = ((HSSFRichTextString)str).GetFontOfFormattingRun(i);
         out1.WriteShort(fontIndex == HSSFRichTextString.NO_FONT ? 0 : fontIndex);
         out1.WriteInt(0); // skip reserved
     }
     out1.WriteShort(str.Length);
     out1.WriteShort(0);
     out1.WriteInt(0); // skip reserved
 }