From 8476be0735213b994e6933730440649fe5f75573 Mon Sep 17 00:00:00 2001 From: Nick Burch Date: Fri, 31 May 2013 17:30:29 +0000 Subject: [PATCH] Fix bug #55001 - check for unicode text too (plus fix indents) git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1488329 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/poi/hslf/model/TextShape.java | 47 ++++++++++--------- 1 file changed, 26 insertions(+), 21 deletions(-) diff --git a/src/scratchpad/src/org/apache/poi/hslf/model/TextShape.java b/src/scratchpad/src/org/apache/poi/hslf/model/TextShape.java index 67341a2672..2ab57380a9 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/model/TextShape.java +++ b/src/scratchpad/src/org/apache/poi/hslf/model/TextShape.java @@ -486,27 +486,32 @@ public abstract class TextShape extends SimpleShape { * @return the TextRun object for this text box */ 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; - } + if (null == this._txtrun) initTextRun(); + if (null == this._txtrun && null != this._txtbox) { + TextHeaderAtom tha = null; + TextBytesAtom tba = null; + TextCharsAtom tca = 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 TextCharsAtom) { + tca = (TextCharsAtom) r; + } else if (r instanceof StyleTextPropAtom) { + sta = (StyleTextPropAtom) r; + } + } + if (tba != null) { + this._txtrun = new TextRun(tha, tba, sta); + } else if (tca != null) { + this._txtrun = new TextRun(tha, tca, sta); + } + } + return _txtrun; + } public void setSheet(Sheet sheet) { _sheet = sheet; -- 2.39.5