From 5b7f7eb4e3409ab77eb9f2d251b457acba2b364b Mon Sep 17 00:00:00 2001 From: Nick Burch Date: Sun, 19 Mar 2006 14:52:23 +0000 Subject: [PATCH] Create empty StyleTextPropAtoms correctly git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@386975 13f79535-47bb-0310-9956-ffa450edef68 --- src/scratchpad/src/org/apache/poi/hslf/model/TextRun.java | 4 ++-- .../src/org/apache/poi/hslf/record/StyleTextPropAtom.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/scratchpad/src/org/apache/poi/hslf/model/TextRun.java b/src/scratchpad/src/org/apache/poi/hslf/model/TextRun.java index 8e392d8310..7ebb280347 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/model/TextRun.java +++ b/src/scratchpad/src/org/apache/poi/hslf/model/TextRun.java @@ -293,8 +293,8 @@ public class TextRun return; } - // Create a new one - _styleAtom = new StyleTextPropAtom(0); + // Create a new one at the right size + _styleAtom = new StyleTextPropAtom(getRawText().length()); // Use the TextHeader atom to get at the parent RecordContainer runAtomsParent = _headerAtom.getParentRecord(); diff --git a/src/scratchpad/src/org/apache/poi/hslf/record/StyleTextPropAtom.java b/src/scratchpad/src/org/apache/poi/hslf/record/StyleTextPropAtom.java index b7d2230b55..148227136d 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/record/StyleTextPropAtom.java +++ b/src/scratchpad/src/org/apache/poi/hslf/record/StyleTextPropAtom.java @@ -173,7 +173,7 @@ public class StyleTextPropAtom extends RecordAtom paragraphStyles = new LinkedList(); charStyles = new LinkedList(); - TextPropCollection defaultParagraphTextProps = new TextPropCollection(parentTextSize); + TextPropCollection defaultParagraphTextProps = new TextPropCollection(parentTextSize, (short)0); paragraphStyles.add(defaultParagraphTextProps); TextPropCollection defaultCharacterTextProps = new TextPropCollection(parentTextSize); -- 2.39.5