From 829a9d18f9eef2c0cb0eb50dc8dfa1db32402ffa Mon Sep 17 00:00:00 2001 From: Sergey Vladimirov Date: Sat, 9 Jul 2011 11:39:02 +0000 Subject: [PATCH] make sure all complex properties are correctly initialized and cloned git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1144654 13f79535-47bb-0310-9956-ffa450edef68 --- .../poi/hwpf/usermodel/ParagraphProperties.java | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/scratchpad/src/org/apache/poi/hwpf/usermodel/ParagraphProperties.java b/src/scratchpad/src/org/apache/poi/hwpf/usermodel/ParagraphProperties.java index 107ca463f..9e91d6c83 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/usermodel/ParagraphProperties.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/usermodel/ParagraphProperties.java @@ -25,15 +25,17 @@ public final class ParagraphProperties extends PAPAbstractType implements private boolean jcLogical = false; public ParagraphProperties() { - setLspd(new LineSpacingDescriptor()); - setPhe(new byte[12]); + setAnld(new byte[84]); setBrcTop(new BorderCode()); setBrcLeft(new BorderCode()); setBrcBottom(new BorderCode()); setBrcRight(new BorderCode()); setBrcBetween(new BorderCode()); setBrcBar(new BorderCode()); - setAnld(new byte[84]); + setDcs( new DropCapSpecifier() ); + setLspd( new LineSpacingDescriptor() ); + setShd( new ShadingDescriptor() ); + setPhe( new byte[12] ); setWidowControl(true); getLspd().setMultiLinespace((short) 1); @@ -275,15 +277,17 @@ public final class ParagraphProperties extends PAPAbstractType implements public Object clone() throws CloneNotSupportedException { ParagraphProperties pp = (ParagraphProperties) super.clone(); - pp.setLspd((LineSpacingDescriptor) this.getLspd().clone()); - pp.setPhe(getPhe().clone()); + pp.setAnld(getAnld().clone()); pp.setBrcTop((BorderCode) getBrcTop().clone()); pp.setBrcLeft((BorderCode) getBrcLeft().clone()); pp.setBrcBottom((BorderCode) getBrcBottom().clone()); pp.setBrcRight((BorderCode) getBrcRight().clone()); pp.setBrcBetween((BorderCode) getBrcBetween().clone()); pp.setBrcBar((BorderCode) getBrcBar().clone()); - pp.setAnld(getAnld().clone()); + pp.setDcs( getDcs().clone() ); + pp.setLspd( (LineSpacingDescriptor) getLspd().clone() ); + pp.setShd( (ShadingDescriptor) getShd().clone() ); + pp.setPhe( getPhe().clone() ); return pp; }