there is two question: 1. Manually create a ShapeGroup in slide, and the ShapeGroup contains a TextBox. If the TextBox includes chinese character in it. When extract the ppt using POI, the TextRun of TextBox is null, and the text in TextBox will also null. 2. I use POI create PPT includes a ShapeGroup, the ShapeGroup has some TextBoxs in it. Then using POI to parse the ppt, the TextRun of TextBox in ShapeGroup is null. Thanks very much, I really confused. I am eager for your reply. Thanks in advance.
I have solved this problem. the class TextShape has some problem. Function getTextRun() is as follows: public TextRun getTextRun(){ if (null == this._txtrun) initTextRun(); if (null == this._txtrun && null != this._txtbox) { TextHeaderAtom tha = null; TextBytesAtom tba = null; StyleTextPropAtom sta = null; Record[] childRecords = this._txtbox.getChildRecords(); for (Record r : childRecords) { if (r instanceof TextHeaderAtom) { tha = (TextHeaderAtom) r; } else if (r instanceof TextBytesAtom) { tba = (TextBytesAtom) r; } else if (r instanceof StyleTextPropAtom) { sta = (StyleTextPropAtom) r; } } if (null != tba) { this._txtrun = new TextRun(tha, tba, sta); } } return _txtrun; } but sometimes the text is not TextBytesAtom but TextCharsAtom. And TextRun has two construct function. in this case, we should use another construct function. Rewrite it as: public TextRun getTextRun() { // TODO Auto-generated method stub if (null == this._txtrun) initTextRun(); if (null == this._txtrun && null != this._txtbox) { TextHeaderAtom tha = null; TextBytesAtom tba = null; StyleTextPropAtom sta = null; TextCharsAtom tca = null; Record[] childRecords = this._txtbox.getChildRecords(); for (Record r : childRecords) { if (r instanceof TextHeaderAtom) { tha = (TextHeaderAtom) r; } else if (r instanceof TextBytesAtom) { tba = (TextBytesAtom) r; } else if (r instanceof StyleTextPropAtom) { sta = (StyleTextPropAtom) r; }else if (r instanceof TextCharsAtom) { tca = (TextCharsAtom) r; } } if (null != tba) { this._txtrun = new TextRun(tha, tba, sta); }else if (null != tca) { this._txtrun = new TextRun(tha, tca, sta); } } return _txtrun; } }