Пример #1
0
        /// <summary> Constructs this object from the raw data
        ///
        /// </summary>
        /// <param name="t">the raw data
        /// </param>
        /// <param name="continuations">the continuations
        /// </param>
        /// <param name="ws">the workbook settings
        /// </param>
        public SSTRecord(Record t, Record[] continuations, WorkbookSettings ws) : base(t)
        {
            // If a continue record appears in the middle of
            // a string, then the encoding character is repeated

            // Concatenate everything into one big bugger of a byte array
            int totalRecordLength = 0;

            for (int i = 0; i < continuations.Length; i++)
            {
                totalRecordLength += continuations[i].Length;
            }
            totalRecordLength += getRecord().Length;

            sbyte[] data = new sbyte[totalRecordLength];

            // First the original data gets put in
            int pos = 0;

            Array.Copy(getRecord().Data, 0, data, 0, getRecord().Length);
            pos += getRecord().Length;

            // Now copy in everything else.
            continuationBreaks = new int[continuations.Length];
            Record r = null;

            for (int i = 0; i < continuations.Length; i++)
            {
                r = continuations[i];
                Array.Copy(r.Data, 0, data, pos, r.Length);
                continuationBreaks[i] = pos;
                pos += r.Length;
            }

            totalStrings  = IntegerHelper.getInt(data[0], data[1], data[2], data[3]);
            uniqueStrings = IntegerHelper.getInt(data[4], data[5], data[6], data[7]);

            strings = new string[uniqueStrings];
            readStrings(data, 8, ws);
        }
Пример #2
0
        /// <summary> Constructs this object from the raw data
        ///
        /// </summary>
        /// <param name="t">the record data
        /// </param>
        /// <param name="ws">the workbook settings
        /// </param>
        internal FooterRecord(Record t, WorkbookSettings ws) : base(t)
        {
            sbyte[] data = getRecord().Data;

            if (data.Length == 0)
            {
                return;
            }

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

            bool unicode = data[2] == 1;

            if (unicode)
            {
                footer = StringHelper.getUnicodeString(data, chars, 3);
            }
            else
            {
                footer = StringHelper.getString(data, chars, 3, ws);
            }
        }
Пример #3
0
 /// <summary> Constructor
 ///
 /// </summary>
 /// <param name="r">the raw record
 /// </param>
 internal LeftMarginRecord(Record r) : base(NExcel.Biff.Type.LEFTMARGIN, r)
 {
 }
Пример #4
0
 /// <summary> Constructor</summary>
 /// <param name="r">the record
 /// </param>
 internal RightMarginRecord(Record r) : base(NExcel.Biff.Type.RIGHTMARGIN, r)
 {
 }
Пример #5
0
 /// <summary> Constructs this number
 ///
 /// </summary>
 /// <param name="t">the record
 /// </param>
 /// <param name="fr">the formatting records
 /// </param>
 /// <param name="es">the external sheet
 /// </param>
 /// <param name="nt">the name table
 /// </param>
 /// <param name="si">the sheet
 /// </param>
 /// <param name="pos">the position of the next record in the file
 /// </param>
 public BaseSharedFormulaRecord(Record t, FormattingRecords fr, ExternalSheet es, WorkbookMethods nt, SheetImpl si, int pos) : base(t, fr, si)
 {
     externalSheet = es;
     nameTable     = nt;
     filePos       = pos;
 }