/**
         * Constructs a CalcCountRecord and Sets its fields appropriately
         * @param in the RecordInputstream to Read the record from
         *
         */

        public CalcCountRecord(RecordInputStream in1)
        {
            field_1_iterations = in1.ReadShort();
        }
Exemple #2
0
 public DrawingRecord(RecordInputStream in1)
 {
     recordData = in1.ReadRemainder();
 }
Exemple #3
0
 /**
  * reads only the range (1 {@link CellRangeAddress8Bit}) from the stream
  */
 public SharedValueRecordBase(RecordInputStream in1)
 {
     _range = new CellRangeAddress8Bit(in1);
 }
        public ExternalNameRecord(RecordInputStream in1)
        {
            field_1_option_flag = in1.ReadShort();
            field_2_ixals       = in1.ReadShort();
            field_3_not_used    = in1.ReadShort();
            int numChars = in1.ReadUByte();

            field_4_name = StringUtil.ReadUnicodeString(in1, numChars);

            // the record body can take different forms.
            // The form is dictated by the values of 3-th and 4-th bits in field_1_option_flag
            if (!IsOLELink && !IsStdDocumentNameIdentifier)
            {
                // another switch: the fWantAdvise bit specifies whether the body describes
                // an external defined name or a DDE data item
                if (IsAutomaticLink)
                {
                    if (in1.Available() > 0)
                    {
                        //body specifies DDE data item
                        int nColumns = in1.ReadUByte() + 1;
                        int nRows    = in1.ReadShort() + 1;

                        int totalCount = nRows * nColumns;
                        _ddeValues = ConstantValueParser.Parse(in1, totalCount);
                        _nColumns  = nColumns;
                        _nRows     = nRows;
                    }
                }
                else
                {
                    //body specifies an external defined name
                    int formulaLen = in1.ReadUShort();
                    field_5_name_definition = Formula.Read(formulaLen, in1);
                }
            }
            //int nameLength = in1.ReadUByte();
            //int multibyteFlag = in1.ReadUByte();
            //if (multibyteFlag == 0)
            //{
            //    field_4_name = in1.ReadCompressedUnicode(nameLength);
            //}
            //else
            //{
            //    field_4_name = in1.ReadUnicodeLEString(nameLength);
            //}
            //if (!HasFormula)
            //{
            //    if (!IsStdDocumentNameIdentifier && !IsOLELink && IsAutomaticLink)
            //    {
            //        // both need to be incremented
            //        int nColumns = in1.ReadUByte() + 1;
            //        int nRows = in1.ReadShort() + 1;

            //        int totalCount = nRows * nColumns;
            //        _ddeValues = ConstantValueParser.Parse(in1, totalCount);
            //        _nColumns = nColumns;
            //        _nRows = nRows;
            //    }

            //    if (in1.Remaining > 0)
            //    {
            //        throw ReadFail("Some Unread data (is formula present?)");
            //    }
            //    field_5_name_definition = null;
            //    return;
            //}
            //int nBytesRemaining = in1.Available();
            //if (in1.Remaining <= 0)
            //{
            //    throw ReadFail("Ran out of record data trying to read formula.");
            //}
            //short formulaLen = in1.ReadShort();
            //nBytesRemaining -= 2;
            //field_5_name_definition = Frame.Utils.NPOI.SS.Formula.Formula.Read(formulaLen, in1, nBytesRemaining);
        }
Exemple #5
0
 /**
  * Constructs a Extern Sheet Sub Record record and Sets its fields appropriately.
  *
  * @param in the RecordInputstream to Read the record from
  */
 public ExternSheetSubRecord(RecordInputStream in1)
 {
     field_1_index_to_supbook             = in1.ReadShort();
     field_2_index_to_first_supbook_sheet = in1.ReadShort();
     field_3_index_to_last_supbook_sheet  = in1.ReadShort();
 }
Exemple #6
0
        /**
         * Constructs a DBCellRecord and Sets its fields appropriately.
         * @param in the RecordInputstream to Read the record from
         */

        public DSFRecord(RecordInputStream in1) : this(in1.ReadShort())
        {
        }
        /**
         * Constructs a ProtectionRev4 record and Sets its fields appropriately.
         * @param in the RecordInputstream to Read the record from
         */

        public ProtectionRev4Record(RecordInputStream in1) :
            this(in1.ReadShort())
        {
        }
        /**
         * Constructs a DateWindow1904 record and Sets its fields appropriately.
         * @param in the RecordInputstream to Read the record from
         */

        public DateWindow1904Record(RecordInputStream in1)
        {
            field_1_window = in1.ReadShort();
        }
Exemple #9
0
        /**
         * Constructs a Number record and Sets its fields appropriately.
         *
         * @param in the RecordInputstream to Read the record from
         */

        public NumberRecord(RecordInputStream in1) : base(in1)
        {
            field_4_value = in1.ReadDouble();
        }
Exemple #10
0
        /**
         * Constructs a PrintHeaders record and Sets its fields appropriately.
         * @param in the RecordInputstream to Read the record from
         */

        public PrintHeadersRecord(RecordInputStream in1)
        {
            field_1_print_headers = in1.ReadShort();
        }
Exemple #11
0
 public PrintSizeRecord(RecordInputStream in1)
 {
     printSize = in1.ReadShort();
 }
Exemple #12
0
        /**
         * Constructs a RefMode record and Sets its fields appropriately.
         * @param in the RecordInputstream to Read the record from
         */

        public RefModeRecord(RecordInputStream in1)
        {
            field_1_mode = in1.ReadShort();
        }
Exemple #13
0
 public Excel9FileRecord(RecordInputStream in1)
 {
 }
Exemple #14
0
 /**
  * Constructs a LeftMargin record and Sets its fields appropriately.
  *
  * @param in the RecordInputstream to Read the record from
  */
 public LeftMarginRecord(RecordInputStream in1)
 {
     field_1_margin = in1.ReadDouble();
 }
 public InfoSubRecord(RecordInputStream in1)
 {
     field_1_stream_pos        = in1.ReadInt();
     field_2_bucket_sst_offset = in1.ReadShort();
     field_3_zero = in1.ReadShort();
 }
        /**
         * Constructs a Protect record and Sets its fields appropriately.
         * @param in the RecordInputstream to Read the record from
         */

        public ObjectProtectRecord(RecordInputStream in1)
        {
            field_1_protect = in1.ReadShort();
        }
Exemple #17
0
        /**
         * Constructs a PasswordRev4 (PROT4REVPASS) record and Sets its fields appropriately.
         * @param in the RecordInputstream to Read the record from
         */

        public PasswordRev4Record(RecordInputStream in1)
        {
            field_1_password = in1.ReadShort();
        }
 public DrawingRecordForBiffViewer(RecordInputStream in1)
     : base(in1)
 {
 }
Exemple #19
0
        /**
         * Constructs an LabelSST record and Sets its fields appropriately.
         * @param in the RecordInputstream to Read the record from
         */

        public LabelSSTRecord(RecordInputStream in1)
            : base(in1)
        {
            field_4_sst_index = in1.ReadInt();
        }
Exemple #20
0
 private static byte[] Read(RecordInputStream in1, int size)
 {
     byte[] result = new byte[size];
     in1.ReadFully(result);
     return(result);
 }
Exemple #21
0
        /**
         * Constructs a Precision record and Sets its fields appropriately.
         * @param in the RecordInputstream to Read the record from
         */

        public PrecisionRecord(RecordInputStream in1)
        {
            field_1_precision = in1.ReadShort();
        }
Exemple #22
0
        /**
         * Constructs a BlankRecord and Sets its fields appropriately
         * @param in the RecordInputstream to Read the record from
         */

        public BlankRecord(RecordInputStream in1)
        {
            field_1_row = in1.ReadUShort();
            field_2_col = in1.ReadShort();
            field_3_xf  = in1.ReadShort();
        }
Exemple #23
0
        /**
         * Constructs a GridSet record and Sets its fields appropriately.
         * @param in the RecordInputstream to Read the record from
         */

        public GridsetRecord(RecordInputStream in1)
        {
            field_1_gridset_flag = in1.ReadShort();
        }
Exemple #24
0
        /**
         * Constructs a CountryRecord and Sets its fields appropriately
         * @param in the RecordInputstream to Read the record from
         */

        public CountryRecord(RecordInputStream in1)
        {
            field_1_default_country = in1.ReadShort();
            field_2_current_country = in1.ReadShort();
        }
Exemple #25
0
        /**
         * Constructs a OBJ record and Sets its fields appropriately.
         *
         * @param in the RecordInputstream to Read the record from
         */

        public ObjRecord(RecordInputStream in1)
        {
            // TODO - problems with OBJ sub-records stream
            // MS spec says first sub-record is always CommonObjectDataSubRecord,
            // and last is
            // always EndSubRecord. OOO spec does not mention ObjRecord(0x005D).
            // Existing POI test data seems to violate that rule. Some test data
            // seems to contain
            // garbage, and a crash is only averted by stopping at what looks like
            // the 'EndSubRecord'

            //Check if this can be continued, if so then the
            //following wont work properly
            //int subSize = 0;
            byte[] subRecordData = in1.ReadRemainder();

            if (LittleEndian.GetUShort(subRecordData, 0) != CommonObjectDataSubRecord.sid)
            {
                // seems to occur in just one junit on "OddStyleRecord.xls" (file created by CrystalReports)
                // Excel tolerates the funny ObjRecord, and replaces it with a corrected version
                // The exact logic/reasoning is not yet understood
                _uninterpretedData = subRecordData;
                subrecords         = null;
                return;
            }
            //if (subRecordData.Length % 2 != 0)
            //{
            //    String msg = "Unexpected length of subRecordData : " + HexDump.ToHex(subRecordData);
            //    throw new RecordFormatException(msg);
            //}
            subrecords = new List <SubRecord>();
            using (MemoryStream bais = new MemoryStream(subRecordData))
            {
                LittleEndianInputStream   subRecStream = new LittleEndianInputStream(bais);
                CommonObjectDataSubRecord cmo          = (CommonObjectDataSubRecord)SubRecord.CreateSubRecord(subRecStream, 0);
                subrecords.Add(cmo);
                while (true)
                {
                    SubRecord subRecord = SubRecord.CreateSubRecord(subRecStream, cmo.ObjectType);
                    subrecords.Add(subRecord);
                    if (subRecord.IsTerminating)
                    {
                        break;
                    }
                }
                int nRemainingBytes = subRecStream.Available();
                if (nRemainingBytes > 0)
                {
                    // At present (Oct-2008), most unit test samples have (subRecordData.length % 2 == 0)
                    _isPaddedToQuadByteMultiple = subRecordData.Length % MAX_PAD_ALIGNMENT == 0;
                    if (nRemainingBytes >= (_isPaddedToQuadByteMultiple ? MAX_PAD_ALIGNMENT : NORMAL_PAD_ALIGNMENT))
                    {
                        if (!CanPaddingBeDiscarded(subRecordData, nRemainingBytes))
                        {
                            String msg = "Leftover " + nRemainingBytes
                                         + " bytes in subrecord data " + HexDump.ToHex(subRecordData);
                            throw new RecordFormatException(msg);
                        }
                        _isPaddedToQuadByteMultiple = false;
                    }
                }
                else
                {
                    _isPaddedToQuadByteMultiple = false;
                }
                _uninterpretedData = null;
            }
        }
Exemple #26
0
        /**
         * Constructs a RECALCID record and Sets its fields appropriately.
         * @param in the RecordInputstream to Read the record from
         */

        public RecalcIdRecord(RecordInputStream in1)
        {
            in1.ReadUShort(); // field 'rt' should have value 0x01C1, but Excel doesn't care during reading
            _reserved0 = in1.ReadUShort();
            _engineId  = in1.ReadInt();
        }
Exemple #27
0
        /**
         * Constructs an HCenter record and Sets its fields appropriately.
         * @param in the RecordInputstream to Read the record from
         */

        public HCenterRecord(RecordInputStream in1)
        {
            field_1_hcenter = in1.ReadShort();
        }
Exemple #28
0
        /**
         * Constructs a RK record and Sets its fields appropriately.
         * @param in the RecordInputstream to Read the record from
         */

        public RKRecord(RecordInputStream in1)
            : base(in1)
        {
            field_4_rk_number = in1.ReadInt();
        }
Exemple #29
0
 public Break(RecordInputStream in1)
 {
     main    = in1.ReadUShort() - 1;
     subFrom = in1.ReadUShort();
     subTo   = in1.ReadUShort();
 }
Exemple #30
0
 private RkRec(RecordInputStream in1)
 {
     xf = in1.ReadShort();
     rk = in1.ReadInt();
 }