Beispiel #1
0
        public void TestAbnormalPivotTableRecords_bug46280()
        {
            int SXVIEW_SID = ViewDefinitionRecord.sid;

            Record[] inRecs =
            {
                new RowRecord(0),
                new NumberRecord(),
                // normally MSODRAWING(0x00EC) would come here before SXVIEW
                new UnknownRecord(SXVIEW_SID,System.Text.Encoding.UTF8.GetBytes("dummydata (SXVIEW: View DefInition)")),
                new WindowTwoRecord(),
            };
            RecordStream    rs  = new RecordStream(inRecs.ToList(), 0);
            RowBlocksReader rbr = new RowBlocksReader(rs);

            if (rs.PeekNextClass() == typeof(WindowTwoRecord))
            {
                // Should have stopped at the SXVIEW record
                throw new AssertionException("Identified bug 46280b");
            }
            RecordStream rbStream = rbr.PlainRecordStream;

            Assert.AreEqual(inRecs[0], rbStream.GetNext());
            Assert.AreEqual(inRecs[1], rbStream.GetNext());
            Assert.IsFalse(rbStream.HasNext());
            Assert.IsTrue(rs.HasNext());
            Assert.AreEqual(inRecs[2], rs.GetNext());
            Assert.AreEqual(inRecs[3], rs.GetNext());
        }
        private void ConstructValueRecord(IList records)
        {
            RowBlocksReader    rbr  = new RowBlocksReader(new RecordStream(records, 0));
            SharedValueManager sfrh = rbr.SharedFormulaManager;
            RecordStream       rs   = rbr.PlainRecordStream;

            while (rs.HasNext())
            {
                Record rec = rs.GetNext();
                valueRecord.Construct((CellValueRecordInterface)rec, rs, sfrh);
            }
        }