https://issues.apache.org/bugzilla/show_bug.cgi?id=55009
Linfei Zhao <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution|--- |FIXED --- Comment #1 from Linfei Zhao <[email protected]> --- 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; } } -- You are receiving this mail because: You are the assignee for the bug. --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
