]> source.dussan.org Git - poi.git/commitdiff
make sure all complex properties are correctly initialized and cloned
authorSergey Vladimirov <sergey@apache.org>
Sat, 9 Jul 2011 11:39:02 +0000 (11:39 +0000)
committerSergey Vladimirov <sergey@apache.org>
Sat, 9 Jul 2011 11:39:02 +0000 (11:39 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1144654 13f79535-47bb-0310-9956-ffa450edef68

src/scratchpad/src/org/apache/poi/hwpf/usermodel/ParagraphProperties.java

index 107ca463fca9dca2f7e4872f123df24084ee7c85..9e91d6c83d65e7d9edcacd7c4949bc8bf01bfe6f 100644 (file)
@@ -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;
     }