Exemple #1
0
        public void TestCreateAggregate()
        {
            String msoDrawingRecord1 =
                "0F 00 02 F0 20 01 00 00 10 00 08 F0 08 00 00 00 " +
                "03 00 00 00 02 04 00 00 0F 00 03 F0 08 01 00 00 " +
                "0F 00 04 F0 28 00 00 00 01 00 09 F0 10 00 00 00 " +
                "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 " +
                "02 00 0A F0 08 00 00 00 00 04 00 00 05 00 00 00 " +
                "0F 00 04 F0 64 00 00 00 42 01 0A F0 08 00 00 00 " +
                "01 04 00 00 00 0A 00 00 73 00 0B F0 2A 00 00 00 " +
                "BF 00 08 00 08 00 44 01 04 00 00 00 7F 01 00 00 " +
                "01 00 BF 01 00 00 11 00 C0 01 40 00 00 08 FF 01 " +
                "10 00 10 00 BF 03 00 00 08 00 00 00 10 F0 12 00 " +
                "00 00 00 00 01 00 54 00 05 00 45 00 01 00 88 03 " +
                "05 00 94 00 00 00 11 F0 00 00 00 00";

            String msoDrawingRecord2 =
                "0F 00 04 F0 64 00 00 00 42 01 0A F0 08 00 00 00 " +
                "02 04 00 00 80 0A 00 00 73 00 0B F0 2A 00 00 00 " +
                "BF 00 08 00 08 00 44 01 04 00 00 00 7F 01 00 00 " +
                "01 00 BF 01 00 00 11 00 C0 01 40 00 00 08 FF 01 " +
                "10 00 10 00 BF 03 00 00 08 00 00 00 10 F0 12 00 " +
                "00 00 00 00 01 00 8D 03 05 00 E4 00 03 00 4D 03 " +
                "0B 00 0C 00 00 00 11 F0 00 00 00 00";

            DrawingRecord d1 = new DrawingRecord();

            d1.Data = (HexRead.ReadFromString(msoDrawingRecord1));

            ObjRecord r1 = new ObjRecord();

            DrawingRecord d2 = new DrawingRecord();

            d2.Data = (HexRead.ReadFromString(msoDrawingRecord2));

            ObjRecord r2 = new ObjRecord();

            ArrayList records = new ArrayList();

            records.Add(d1);
            records.Add(r1);
            records.Add(d2);
            records.Add(r2);

            DrawingManager2 drawingManager = new DrawingManager2(new EscherDggRecord());
            EscherAggregate aggregate      = EscherAggregate.CreateAggregate(records, 0, drawingManager);

            Assert.AreEqual(1, aggregate.EscherRecords.Count);
            Assert.AreEqual(unchecked ((short)0xF002), aggregate.GetEscherRecord(0).RecordId);
            Assert.AreEqual(2, aggregate.GetEscherRecord(0).ChildRecords.Count);

            //        System.out.println( "aggregate = " + aggregate );
        }
Exemple #2
0
        public void TestDgRecordNumShapes()
        {
            HSSFWorkbook  wb        = new HSSFWorkbook();
            HSSFSheet     sheet     = wb.CreateSheet() as HSSFSheet;
            HSSFPatriarch patriarch = sheet.CreateDrawingPatriarch() as HSSFPatriarch;

            EscherAggregate aggregate = HSSFTestHelper.GetEscherAggregate(patriarch);
            EscherDgRecord  dgRecord  = (EscherDgRecord)aggregate.GetEscherRecord(0).GetChild(0) as EscherDgRecord;

            Assert.AreEqual(dgRecord.NumShapes, 1);
        }