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));
     }
 }
Exemple #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);
        }
Exemple #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());
            }
        }
Exemple #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();
 }
        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);
        }
Exemple #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);
        }
Exemple #7
0
 internal override void AfterRemove(HSSFPatriarch patriarch)
 {
     throw new InvalidOperationException("HSSFObjectData cannot be created from scratch");
 }
Exemple #8
0
 internal abstract void AfterInsert(HSSFPatriarch patriarch);
Exemple #9
0
 internal abstract void AfterRemove(HSSFPatriarch patriarch);
Exemple #10
0
 internal override void AfterInsert(HSSFPatriarch patriarch)
 {
     base.AfterInsert(patriarch);
     patriarch.GetBoundAggregate().AddTailRecord(NoteRecord);
 }
Exemple #11
0
 internal override void AfterRemove(HSSFPatriarch patriarch)
 {
     base.AfterRemove(patriarch);
     patriarch.GetBoundAggregate().RemoveTailRecord(NoteRecord);
 }