internal override void AfterRemove(HSSFPatriarch patriarch)
 {
     patriarch.GetBoundAggregate().RemoveShapeToObjRecord(GetEscherContainer().GetChildById(EscherClientDataRecord.RECORD_ID));
     if (null != GetEscherContainer().GetChildById(EscherTextboxRecord.RECORD_ID))
     {
         patriarch.GetBoundAggregate().RemoveShapeToObjRecord(GetEscherContainer().GetChildById(EscherTextboxRecord.RECORD_ID));
     }
 }
Example #2
0
        internal override void AfterInsert(HSSFPatriarch patriarch)
        {
            EscherAggregate agg = patriarch.GetBoundAggregate();

            agg.AssociateShapeToObjRecord(GetEscherContainer().GetChildById(EscherClientDataRecord.RECORD_ID), GetObjRecord());
            EscherBSERecord bse =
                ((HSSFWorkbook)patriarch.Sheet.Workbook).Workbook.GetBSERecord(PictureIndex);

            bse.Ref = (bse.Ref + 1);
        }
Example #3
0
        internal override void AfterInsert(HSSFPatriarch patriarch)
        {
            EscherAggregate agg = patriarch.GetBoundAggregate();

            agg.AssociateShapeToObjRecord(GetEscherContainer().GetChildById(EscherClientDataRecord.RECORD_ID), GetObjRecord());
            if (GetTextObjectRecord() != null)
            {
                agg.AssociateShapeToObjRecord(GetEscherContainer().GetChildById(EscherTextboxRecord.RECORD_ID), GetTextObjectRecord());
            }
        }
Example #4
0
 internal override void AfterRemove(HSSFPatriarch patriarch)
 {
     patriarch.GetBoundAggregate().RemoveShapeToObjRecord(GetEscherContainer().ChildContainers[0]
                                                          .GetChildById(EscherClientDataRecord.RECORD_ID));
     for (int i = 0; i < shapes.Count; i++)
     {
         HSSFShape shape = (HSSFShape)shapes[i];
         RemoveShape(shape);
         shape.AfterRemove(Patriarch);
     }
     shapes.Clear();
 }
Example #5
0
        public static HSSFPatriarch CreatePatriarch(HSSFPatriarch patriarch, HSSFSheet sheet)
        {
            HSSFPatriarch newPatriarch = new HSSFPatriarch(sheet, new EscherAggregate(true));

            newPatriarch.AfterCreate();
            foreach (HSSFShape shape in patriarch.Children)
            {
                HSSFShape newShape;
                if (shape is HSSFShapeGroup)
                {
                    newShape = ((HSSFShapeGroup)shape).CloneShape(newPatriarch);
                }
                else
                {
                    newShape = shape.CloneShape();
                }
                newPatriarch.OnCreate(newShape);
                newPatriarch.AddShape(newShape);
            }
            return(newPatriarch);
        }
Example #6
0
        internal HSSFShape CloneShape(HSSFPatriarch patriarch)
        {
            EscherContainerRecord spgrContainer = new EscherContainerRecord();

            spgrContainer.RecordId = (EscherContainerRecord.SPGR_CONTAINER);
            spgrContainer.Options  = ((short)0x000F);
            EscherContainerRecord spContainer = new EscherContainerRecord();
            EscherContainerRecord cont        = (EscherContainerRecord)GetEscherContainer().GetChildById(EscherContainerRecord.SP_CONTAINER);

            byte[] inSp = cont.Serialize();
            spContainer.FillFields(inSp, 0, new DefaultEscherRecordFactory());

            spgrContainer.AddChildRecord(spContainer);
            ObjRecord obj = null;

            if (null != this.GetObjRecord())
            {
                obj = (ObjRecord)this.GetObjRecord().CloneViaReserialise();
            }

            HSSFShapeGroup group = new HSSFShapeGroup(spgrContainer, obj);

            group.Patriarch = patriarch;

            foreach (HSSFShape shape in Children)
            {
                HSSFShape newShape;
                if (shape is HSSFShapeGroup)
                {
                    newShape = ((HSSFShapeGroup)shape).CloneShape(patriarch);
                }
                else
                {
                    newShape = shape.CloneShape();
                }
                group.AddShape(newShape);
                group.OnCreate(newShape);
            }
            return(group);
        }
Example #7
0
 internal override void AfterRemove(HSSFPatriarch patriarch)
 {
     throw new InvalidOperationException("HSSFObjectData cannot be created from scratch");
 }
Example #8
0
 internal abstract void AfterInsert(HSSFPatriarch patriarch);
Example #9
0
 internal abstract void AfterRemove(HSSFPatriarch patriarch);
Example #10
0
 internal override void AfterInsert(HSSFPatriarch patriarch)
 {
     base.AfterInsert(patriarch);
     patriarch.GetBoundAggregate().AddTailRecord(NoteRecord);
 }
Example #11
0
 internal override void AfterRemove(HSSFPatriarch patriarch)
 {
     base.AfterRemove(patriarch);
     patriarch.GetBoundAggregate().RemoveTailRecord(NoteRecord);
 }