]> source.dussan.org Git - poi.git/commitdiff
initialize more TAPAbstractType fields to prevent NPE
authorSergey Vladimirov <sergey@apache.org>
Thu, 7 Jul 2011 07:39:53 +0000 (07:39 +0000)
committerSergey Vladimirov <sergey@apache.org>
Thu, 7 Jul 2011 07:39:53 +0000 (07:39 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1143694 13f79535-47bb-0310-9956-ffa450edef68

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

index f18a29328a94e33b9b3487e82cd6205a9b4b9f6a..498ee59ec5d25f574d37215b0b89ad2f28ba0960 100644 (file)
@@ -24,12 +24,22 @@ public final class TableProperties extends TAPAbstractType implements Cloneable
 
     public TableProperties()
     {
-
+        setTlp( new TableAutoformatLookSpecifier() );
+        setShdTable( new ShadingDescriptor() );
+        setBrcBottom( new BorderCode() );
+        setBrcHorizontal( new BorderCode() );
+        setBrcLeft( new BorderCode() );
+        setBrcRight( new BorderCode() );
+        setBrcTop( new BorderCode() );
+        setBrcVertical( new BorderCode() );
+        setRgbrcInsideDefault_0( new BorderCode() );
+        setRgbrcInsideDefault_1( new BorderCode() );
     }
 
     public TableProperties( short columns )
     {
-        setTlp( new TableAutoformatLookSpecifier() );
+        this();
+
         setItcMac( columns );
         setRgshd( new ShadingDescriptor[columns] );
 
@@ -38,16 +48,6 @@ public final class TableProperties extends TAPAbstractType implements Cloneable
             getRgshd()[x] = new ShadingDescriptor();
         }
 
-        setBrcBottom( new BorderCode() );
-        setBrcHorizontal( new BorderCode() );
-        setBrcLeft( new BorderCode() );
-        setBrcRight( new BorderCode() );
-        setBrcTop( new BorderCode() );
-        setBrcVertical( new BorderCode() );
-
-        setRgbrcInsideDefault_0( new BorderCode() );
-        setRgbrcInsideDefault_1( new BorderCode() );
-
         TableCellDescriptor[] tableCellDescriptors = new TableCellDescriptor[columns];
         for ( int x = 0; x < columns; x++ )
         {