public void TestConstruct() { ObjRecord record = new ObjRecord(); CommonObjectDataSubRecord ftCmo = new CommonObjectDataSubRecord(); ftCmo.ObjectType = (CommonObjectType.COMMENT); ftCmo.ObjectId = ((short)1024); ftCmo.IsLocked = (true); ftCmo.IsPrintable = (true); ftCmo.IsAutoFill = (true); ftCmo.IsAutoline = (true); record.AddSubRecord(ftCmo); EndSubRecord ftEnd = new EndSubRecord(); record.AddSubRecord(ftEnd); //Serialize and Read again byte[] recordBytes = record.Serialize(); //cut off the record header byte[] bytes = new byte[recordBytes.Length - 4]; System.Array.Copy(recordBytes, 4, bytes, 0, bytes.Length); record = new ObjRecord(TestcaseRecordInputStream.Create(ObjRecord.sid, bytes)); IList subrecords = record.SubRecords; Assert.AreEqual(2, subrecords.Count); Assert.IsTrue(subrecords[0] is CommonObjectDataSubRecord); Assert.IsTrue(subrecords[1] is EndSubRecord); }
/** * creates shapes from existing file * @param spContainer * @param objRecord */ public HSSFShape(EscherContainerRecord spContainer, ObjRecord objRecord) { this._escherContainer = spContainer; this._objRecord = objRecord; this._optRecord = (EscherOptRecord)spContainer.GetChildById(EscherOptRecord.RECORD_ID); this.anchor = HSSFAnchor.CreateAnchorFromEscher(spContainer); }
public void Test_47701() { byte[] data = HexRead.ReadFromString( "15, 00, 12, 00, 12, 00, 02, 00, 11, 20, " + "00, 00, 00, 00, 80, 3D, 03, 05, 00, 00, " + "00, 00, 0C, 00, 14, 00, 00, 00, 00, 00, " + "00, 00, 00, 00, 00, 00, 01, 00, 0A, 00, " + "00, 00, 10, 00, 01, 00, 13, 00, EE, 1F, " + "10, 00, 09, 00, 40, 9F, 74, 01, 25, 09, " + "00, 0C, 00, 07, 00, 07, 00, 07, 04, 00, " + "00, 00, 08, 00, 00, 00"); RecordInputStream in1 = TestcaseRecordInputStream.Create(ObjRecord.sid, data); // check read OK ObjRecord record = new ObjRecord(in1); Assert.AreEqual(3, record.SubRecords.Count); SubRecord sr = record.SubRecords[(2)]; Assert.IsTrue(sr is LbsDataSubRecord); LbsDataSubRecord lbs = (LbsDataSubRecord)sr; Assert.AreEqual(4, lbs.NumberOfItems); Assert.IsTrue(lbs.Formula is AreaPtg); AreaPtg ptg = (AreaPtg)lbs.Formula; CellRangeAddress range = new CellRangeAddress( ptg.FirstRow, ptg.LastRow, ptg.FirstColumn, ptg.LastColumn); Assert.AreEqual("H10:H13", range.FormatAsString()); // check that it re-Serializes to the same data byte[] ser = record.Serialize(); TestcaseRecordInputStream.ConfirmRecordEncoding(ObjRecord.sid, data, ser); }
public void TestStore() { ObjRecord record = new ObjRecord(TestcaseRecordInputStream.Create(ObjRecord.sid, recdata)); byte[] recordBytes = record.Serialize(); Assert.AreEqual(26, recordBytes.Length - 4); byte[] subData = new byte[recdata.Length]; System.Array.Copy(recordBytes, 4, subData, 0, subData.Length); Assert.IsTrue(NPOI.Util.Arrays.Equals(recdata, subData)); }
public void TestLoad() { ObjRecord record = new ObjRecord(TestcaseRecordInputStream.Create(ObjRecord.sid, recdata)); Assert.AreEqual(26, record.RecordSize - 4); IList subrecords = record.SubRecords; Assert.AreEqual(2, subrecords.Count); Assert.IsTrue(subrecords[0] is CommonObjectDataSubRecord); Assert.IsTrue(subrecords[1] is EndSubRecord); }
public void TestReadAll_bug45778() { RecordInputStream in1 = TestcaseRecordInputStream.Create(dataAutoFilter); ObjRecord or = new ObjRecord(in1); byte[] data2 = or.Serialize(); if (data2.Length == 8228) { throw new AssertionException("Identified bug 45778"); } Assert.AreEqual(74, data2.Length); Assert.IsTrue(Arrays.Equals(dataAutoFilter, data2)); }
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 ); }
protected override ObjRecord CreateObjRecord() { ObjRecord obj = new ObjRecord(); CommonObjectDataSubRecord c = new CommonObjectDataSubRecord(); c.ObjectType = CommonObjectType.TEXT; c.IsLocked = (true); c.IsPrintable = (true); c.IsAutoFill = (true); c.IsAutoline = (true); EndSubRecord e = new EndSubRecord(); obj.AddSubRecord(c); obj.AddSubRecord(e); return obj; }
protected override ObjRecord CreateObjRecord() { ObjRecord obj = new ObjRecord(); CommonObjectDataSubRecord c = new CommonObjectDataSubRecord(); c.ObjectType = CommonObjectType.ComboBox; c.IsLocked = (true); c.IsPrintable = (false); c.IsAutoFill = (true); c.IsAutoline = (false); FtCblsSubRecord f = new FtCblsSubRecord(); LbsDataSubRecord l = LbsDataSubRecord.CreateAutoFilterInstance(); EndSubRecord e = new EndSubRecord(); obj.AddSubRecord(c); obj.AddSubRecord(f); obj.AddSubRecord(l); obj.AddSubRecord(e); return obj; }
/// <summary> /// Creates the lowerlevel OBJ records for this shape. /// </summary> /// <param name="hssfShape">The HSSF shape.</param> /// <param name="shapeId">The shape id.</param> /// <returns></returns> private ObjRecord CreateObjRecord(HSSFTextbox hssfShape, int shapeId) { HSSFShape shape = hssfShape; ObjRecord obj = new ObjRecord(); CommonObjectDataSubRecord c = new CommonObjectDataSubRecord(); c.ObjectType = (CommonObjectType)((HSSFSimpleShape)shape).ShapeType; c.ObjectId = GetCmoObjectId(shapeId); c.IsLocked = true; c.IsPrintable = true; c.IsAutoFill = true; c.IsAutoline = true; EndSubRecord e = new EndSubRecord(); obj.AddSubRecord(c); obj.AddSubRecord(e); return obj; }
/** * Creates the low level OBJ record for this shape. */ private ObjRecord CreateObjRecord(HSSFSimpleShape shape, int shapeId) { ObjRecord obj = new ObjRecord(); CommonObjectDataSubRecord c = new CommonObjectDataSubRecord(); c.ObjectType= CommonObjectType.COMBO_BOX; c.ObjectId= (short)shapeId; c.IsLocked=(true); c.IsPrintable=false; c.IsAutoFill=true; c.IsAutoline=false; LbsDataSubRecord l = LbsDataSubRecord.CreateAutoFilterInstance(); EndSubRecord e = new EndSubRecord(); obj.AddSubRecord(c); obj.AddSubRecord(l); obj.AddSubRecord(e); return obj; }
public HSSFShapeGroup(EscherContainerRecord spgrContainer, ObjRecord objRecord) : base(spgrContainer, objRecord) { // read internal and external coordinates from spgrContainer EscherContainerRecord spContainer = spgrContainer.ChildContainers[0]; _spgrRecord = (EscherSpgrRecord)spContainer.GetChild(0); foreach (EscherRecord ch in spContainer.ChildRecords) { switch (ch.RecordId) { case EscherSpgrRecord.RECORD_ID: break; case EscherClientAnchorRecord.RECORD_ID: anchor = new HSSFClientAnchor((EscherClientAnchorRecord)ch); break; case EscherChildAnchorRecord.RECORD_ID: anchor = new HSSFChildAnchor((EscherChildAnchorRecord)ch); break; } } }
public HSSFTextbox(EscherContainerRecord spContainer, ObjRecord objRecord, TextObjectRecord textObjectRecord) : base(spContainer, objRecord, textObjectRecord) { }
public HSSFSimpleShape(EscherContainerRecord spContainer, ObjRecord objRecord) : base(spContainer, objRecord) { }
public HSSFSimpleShape(EscherContainerRecord spContainer, ObjRecord objRecord, TextObjectRecord textObjectRecord) : base(spContainer, objRecord) { this._textObjectRecord = textObjectRecord; }
/// <summary> /// Creates the low evel records for an oval. /// </summary> /// <param name="hssfShape">The highlevel shape.</param> /// <param name="shapeId">The shape id to use for this shape.</param> public SimpleFilledShape(HSSFSimpleShape hssfShape, int shapeId) { spContainer = CreateSpContainer(hssfShape, shapeId); objRecord = CreateObjRecord(hssfShape, shapeId); }
/// <summary> /// Creates the low level OBJ record for this shape. /// </summary> /// <param name="hssfShape">The HSSFShape.</param> /// <param name="shapeId">The shape id.</param> /// <returns></returns> private ObjRecord CreateObjRecord(HSSFShape hssfShape, int shapeId) { HSSFShape shape = hssfShape; ObjRecord obj = new ObjRecord(); CommonObjectDataSubRecord c = new CommonObjectDataSubRecord(); c.ObjectType=((short)((HSSFSimpleShape)shape).ShapeType); // c.ObjectId((short) ( 1 )); c.ObjectId=((short)(shapeId)); c.IsLocked=(true); c.IsPrintable=(true); c.IsAutoFill=(true); c.IsAutoline=(true); // c.Reserved2( 0x012C0A84 ); c.Reserved2=(0x0); // UnknownRecord sub1 = new UnknownRecord( (short)0x7, (short)0x2, new byte[] { 0x09, 0x00 } ); // UnknownRecord sub2 = new UnknownRecord( (short)0x8, (short)0x2, new byte[] { 0x01, 0x00 } ); EndSubRecord e = new EndSubRecord(); obj.AddSubRecord(c); // obj.AddSubRecord( sub1 ); // obj.AddSubRecord( sub2 ); obj.AddSubRecord(e); return obj; }
private void ConvertGroup(HSSFShapeGroup shape, EscherContainerRecord escherParent, Hashtable shapeToObj) { EscherContainerRecord spgrContainer = new EscherContainerRecord(); EscherContainerRecord spContainer = new EscherContainerRecord(); EscherSpgrRecord spgr = new EscherSpgrRecord(); EscherSpRecord sp = new EscherSpRecord(); EscherOptRecord opt = new EscherOptRecord(); EscherRecord anchor; EscherClientDataRecord clientData = new EscherClientDataRecord(); spgrContainer.RecordId = EscherContainerRecord.SPGR_CONTAINER; spgrContainer.Options = (short)0x000F; spContainer.RecordId = EscherContainerRecord.SP_CONTAINER; spContainer.Options = (short)0x000F; spgr.RecordId = EscherSpgrRecord.RECORD_ID; spgr.Options = (short)0x0001; spgr.RectX1 = shape.X1; spgr.RectY1 = shape.Y1; spgr.RectX2 = shape.X2; spgr.RectY2 = shape.Y2; sp.RecordId = EscherSpRecord.RECORD_ID; sp.Options = (short)0x0002; int shapeId = drawingManager.AllocateShapeId(drawingGroupId); sp.ShapeId = shapeId; if (shape.Anchor is HSSFClientAnchor) { sp.Flags = EscherSpRecord.FLAG_GROUP | EscherSpRecord.FLAG_HAVEANCHOR; } else { sp.Flags = EscherSpRecord.FLAG_GROUP | EscherSpRecord.FLAG_HAVEANCHOR | EscherSpRecord.FLAG_CHILD; } opt.RecordId = EscherOptRecord.RECORD_ID; opt.Options = (short)0x0023; opt.AddEscherProperty(new EscherBoolProperty(EscherProperties.PROTECTION__LOCKAGAINSTGROUPING, 0x00040004)); opt.AddEscherProperty(new EscherBoolProperty(EscherProperties.GROUPSHAPE__PRINT, 0x00080000)); anchor = ConvertAnchor.CreateAnchor(shape.Anchor); // clientAnchor.Col1( ( (HSSFClientAnchor) shape.Anchor ).Col1 ); // clientAnchor.Row1( (short) ( (HSSFClientAnchor) shape.Anchor ).Row1 ); // clientAnchor.Dx1( (short) shape.Anchor.Dx1 ); // clientAnchor.Dy1( (short) shape.Anchor.Dy1 ); // clientAnchor.Col2( ( (HSSFClientAnchor) shape.Anchor ).Col2 ); // clientAnchor.Row2( (short) ( (HSSFClientAnchor) shape.Anchor ).Row2 ); // clientAnchor.Dx2( (short) shape.Anchor.Dx2 ); // clientAnchor.Dy2( (short) shape.Anchor.Dy2 ); clientData.RecordId = (EscherClientDataRecord.RECORD_ID); clientData.Options = ((short)0x0000); spgrContainer.AddChildRecord(spContainer); spContainer.AddChildRecord(spgr); spContainer.AddChildRecord(sp); spContainer.AddChildRecord(opt); spContainer.AddChildRecord(anchor); spContainer.AddChildRecord(clientData); ObjRecord obj = new ObjRecord(); CommonObjectDataSubRecord cmo = new CommonObjectDataSubRecord(); cmo.ObjectType = CommonObjectType.GROUP; cmo.ObjectId = ((short)(shapeId)); cmo.IsLocked = true; cmo.IsPrintable = true; cmo.IsAutoFill = true; cmo.IsAutoline = true; GroupMarkerSubRecord gmo = new GroupMarkerSubRecord(); EndSubRecord end = new EndSubRecord(); obj.AddSubRecord(cmo); obj.AddSubRecord(gmo); obj.AddSubRecord(end); shapeToObj[clientData] = obj; escherParent.AddChildRecord(spgrContainer); ConvertShapes(shape, spgrContainer, shapeToObj); }
/// <summary> /// Creates the lowerlevel OBJ records for this shape. /// </summary> /// <param name="hssfShape">The HSSF shape.</param> /// <param name="shapeId">The shape id.</param> /// <returns></returns> private ObjRecord CreateObjRecord(HSSFShape hssfShape, int shapeId) { HSSFShape shape = hssfShape; ObjRecord obj = new ObjRecord(); CommonObjectDataSubRecord c = new CommonObjectDataSubRecord(); c.ObjectType = (CommonObjectType)OBJECT_TYPE_MICROSOFT_OFFICE_DRAWING; c.ObjectId = GetCmoObjectId(shapeId); c.IsLocked = true; c.IsPrintable = true; c.IsAutoFill = true; c.IsAutoline = true; EndSubRecord e = new EndSubRecord(); obj.AddSubRecord(c); obj.AddSubRecord(e); return obj; }
protected override ObjRecord CreateObjRecord() { ObjRecord obj = new ObjRecord(); CommonObjectDataSubRecord c = new CommonObjectDataSubRecord(); c.ObjectType = (CommonObjectType)OBJECT_TYPE_COMMENT; c.IsLocked = (true); c.IsPrintable = (true); c.IsAutoFill = (false); c.IsAutoline = (true); NoteStructureSubRecord u = new NoteStructureSubRecord(); EndSubRecord e = new EndSubRecord(); obj.AddSubRecord(c); obj.AddSubRecord(u); obj.AddSubRecord(e); return obj; }
/** * @param obj - ObjRecord with id == NoteRecord.id * @return null if note record is not found else returns note record with id == obj.id */ internal NoteRecord GetNoteRecordByObj(ObjRecord obj) { CommonObjectDataSubRecord cod = (CommonObjectDataSubRecord)obj.SubRecords[0]; if (!tailRec.ContainsKey(cod.ObjectId)) return null; return tailRec[(cod.ObjectId)]; }
public void Test_Remove_padding() { byte[] data = HexRead.ReadFromString( "5D, 00, 4C, 00, " + "15, 00, 12, 00, 12, 00, 01, 00, 11, 00, " + "00, 00, 00, 00, 00, 00, 00, 00, 00, 00, " + "00, 00, 0C, 00, 14, 00, 00, 00, 00, 00, " + "00, 00, 00, 00, 00, 00, 01, 00, 09, 00, " + "00, 00, 0F, 00, 01, 00, " + "13, 00, 1B, 00, " + "10, 00, " + //next 16 bytes is a ptg aray "09, 00, 00, 00, 00, 00, 25, 09, 00, 0C, 00, 07, 00, 07, 00, 00, " + "01, 00, " + //num lines "00, 00, " + //selected "08, 00, " + "00, 00, " + "00, 00, 00, 00, 00"); //pAdding bytes RecordInputStream in1 = TestcaseRecordInputStream.Create(data); // check read OK ObjRecord record = new ObjRecord(in1); // check that it re-Serializes to the same data byte[] ser = record.Serialize(); Assert.AreEqual(data.Length - 5, ser.Length); for (int i = 0; i < ser.Length; i++) Assert.AreEqual(data[i], ser[i]); //check we can read the Trimmed record RecordInputStream in2 = TestcaseRecordInputStream.Create(ser); ObjRecord record2 = new ObjRecord(in2); byte[] ser2 = record2.Serialize(); Assert.IsTrue(Arrays.Equals(ser, ser2)); }
/// <summary> /// Create a new shape with the specified parent and anchor. /// </summary> /// <param name="parent">The parent.</param> /// <param name="anchor">The anchor.</param> public HSSFShape(HSSFShape parent, HSSFAnchor anchor) { this.parent = parent; this.anchor = anchor; this._escherContainer = CreateSpContainer(); _optRecord = (EscherOptRecord)_escherContainer.GetChildById(EscherOptRecord.RECORD_ID); _objRecord = CreateObjRecord(); }
//private TextObjectRecord txo = null; public HSSFComment(EscherContainerRecord spContainer, ObjRecord objRecord, TextObjectRecord textObjectRecord, NoteRecord _note) : base(spContainer, objRecord, textObjectRecord) { this._note = _note; }
public void Test_45778() { byte[] data = HexRead.ReadFromString( "15, 00, 12, 00, 14, 00, 01, 00, 01, 00, " + "01, 21, 00, 00, 3C, 13, F4, 03, 00, 00, " + "00, 00, 0C, 00, 14, 00, 00, 00, 00, 00, " + "00, 00, 00, 00, 00, 00, 01, 00, 08, 00, 00, " + "00, 10, 00, 00, 00, " + "13, 00, EE, 1F, " + "00, 00, " + "08, 00, " + //number of items "08, 00, " + //selected item "01, 03, " + //flags "00, 00, " + //objId //LbsDropData "0A, 00, " + //flags "14, 00, " + //the number of lines to be displayed in the dropdown "6C, 00, " + //the smallest width in pixels allowed for the dropdown window "00, 00, " + //num chars "00, 00"); RecordInputStream in1 = TestcaseRecordInputStream.Create(ObjRecord.sid, data); // check read OK ObjRecord record = new ObjRecord(in1); SubRecord sr = record.SubRecords[(2)]; Assert.IsTrue(sr is LbsDataSubRecord); LbsDataSubRecord lbs = (LbsDataSubRecord)sr; Assert.AreEqual(8, lbs.NumberOfItems); Assert.IsNull(lbs.Formula); // check that it re-Serializes to the same data byte[] ser = record.Serialize(); TestcaseRecordInputStream.ConfirmRecordEncoding(ObjRecord.sid, data, ser); }
/// <summary> /// Creates the low evel records for a textbox. /// </summary> /// <param name="hssfShape">The highlevel shape.</param> /// <param name="shapeId">The shape id to use for this shape.</param> public TextboxShape(HSSFTextbox hssfShape, int shapeId) { spContainer = CreateSpContainer(hssfShape, shapeId); objRecord = CreateObjRecord(hssfShape, shapeId); textObjectRecord = CreateTextObjectRecord(hssfShape, shapeId); }
/// <summary> /// Creates the lowerlevel OBJ records for this shape. /// </summary> /// <param name="hssfShape">The HSSF shape.</param> /// <param name="shapeId">The shape id.</param> /// <returns></returns> private ObjRecord CreateObjRecord(HSSFShape hssfShape, int shapeId) { HSSFShape shape = hssfShape; ObjRecord obj = new ObjRecord(); CommonObjectDataSubRecord c = new CommonObjectDataSubRecord(); c.ObjectType=CommonObjectType.MICROSOFT_OFFICE_DRAWING; c.ObjectId=((short)(shapeId)); c.IsLocked=(true); c.IsPrintable=(true); c.IsAutoFill=(true); c.IsAutoline=(true); EndSubRecord e = new EndSubRecord(); obj.AddSubRecord(c); obj.AddSubRecord(e); return obj; }
public void TestCreateAggregate() { String msoDrawingRecord1 = "0F 00 02 F0 20 01 00 00 10 00 08 F0 08 00 00 00 \n" + "03 00 00 00 02 04 00 00 0F 00 03 F0 08 01 00 00 \n" + "0F 00 04 F0 28 00 00 00 01 00 09 F0 10 00 00 00 \n" + "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \n" + "02 00 0A F0 08 00 00 00 00 04 00 00 05 00 00 00 \n" + "0F 00 04 F0 64 00 00 00 42 01 0A F0 08 00 00 00 \n" + "01 04 00 00 00 0A 00 00 73 00 0B F0 2A 00 00 00 \n" + "BF 00 08 00 08 00 44 01 04 00 00 00 7F 01 00 00 \n" + "01 00 BF 01 00 00 11 00 C0 01 40 00 00 08 FF 01 \n" + "10 00 10 00 BF 03 00 00 08 00 00 00 10 F0 12 00 \n" + "00 00 00 00 01 00 54 00 05 00 45 00 01 00 88 03 \n" + "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)); TextObjectRecord r2 = new TextObjectRecord(); r2.Str = (new HSSFRichTextString("Aggregated")); NoteRecord n2 = new NoteRecord(); List<RecordBase> recordStream = new List<RecordBase>(); recordStream.Add(InternalSheet.CreateBOF()); recordStream.Add(d1); recordStream.Add(r1); recordStream.Add(CreateWindow2Record()); recordStream.Add(EOFRecord.instance); ConfirmAggregatedRecords(recordStream); recordStream = new List<RecordBase>(); recordStream.Add(InternalSheet.CreateBOF()); recordStream.Add(d1); recordStream.Add(r1); recordStream.Add(d2); recordStream.Add(r2); recordStream.Add(CreateWindow2Record()); recordStream.Add(EOFRecord.instance); ConfirmAggregatedRecords(recordStream); recordStream = new List<RecordBase>(); recordStream.Add(InternalSheet.CreateBOF()); recordStream.Add(d1); recordStream.Add(r1); recordStream.Add(d2); recordStream.Add(r2); recordStream.Add(n2); recordStream.Add(CreateWindow2Record()); recordStream.Add(EOFRecord.instance); ConfirmAggregatedRecords(recordStream); }
public override Object Clone() { ObjRecord rec = new ObjRecord(); for (int i = 0; i < subrecords.Count; i++) { SubRecord record = subrecords[i]; rec.AddSubRecord((SubRecord)record.Clone()); } return rec; }
/// <summary> /// Creates the low evel records for an polygon. /// </summary> /// <param name="hssfShape">The highlevel shape.</param> /// <param name="shapeId">The shape id to use for this shape.</param> public PolygonShape(HSSFPolygon hssfShape, int shapeId) { spContainer = CreateSpContainer(hssfShape, shapeId); objRecord = CreateObjRecord(hssfShape, shapeId); }
/** * No NullPointerException should appear */ public void TestDefaultSettingsWithEmptyContainer() { EscherContainerRecord Container = new EscherContainerRecord(); EscherOptRecord opt = new EscherOptRecord(); opt.RecordId=(EscherOptRecord.RECORD_ID); Container.AddChildRecord(opt); ObjRecord obj = new ObjRecord(); CommonObjectDataSubRecord cod = new CommonObjectDataSubRecord(); cod.ObjectType= (CommonObjectType) (HSSFSimpleShape.OBJECT_TYPE_PICTURE); obj.AddSubRecord(cod); HSSFPicture picture = new HSSFPicture(Container, obj); Assert.AreEqual(picture.LineWidth, HSSFShape.LINEWIDTH_DEFAULT); Assert.AreEqual(picture.FillColor, HSSFShape.FILL__FILLCOLOR_DEFAULT); Assert.AreEqual(picture.LineStyle, HSSFShape.LINESTYLE_DEFAULT); Assert.AreEqual(picture.LineStyleColor, HSSFShape.LINESTYLE__COLOR_DEFAULT); Assert.AreEqual(picture.IsNoFill, HSSFShape.NO_FILL_DEFAULT); Assert.AreEqual(picture.PictureIndex, -1);//not Set yet }