/** * When a textbox is Added to a sheet we need to tell upper-level * <code>PPDrawing</code> about it. * * @param sh the sheet we are Adding to */ protected void afterInsert(Sheet sh){ super.afterInsert(sh); EscherTextboxWrapper _txtbox = GetEscherTextboxWrapper(); if(_txtbox != null){ PPDrawing ppdrawing = sh.GetPPDrawing(); ppdrawing.AddTextboxWrapper(_txtbox); // Ensure the escher layer knows about the Added records try { _txtbox.WriteOut(null); } catch (IOException e){ throw new HSLFException(e); } if(getAnchor().Equals(new Rectangle()) && !"".Equals(getText())) resizeToFitText(); } if(_txtrun != null) { _txtRun.SetShapeId(getShapeId()); sh.onAddTextShape(this); } }