]> source.dussan.org Git - poi.git/commitdiff
second field in TC is width
authorSergey Vladimirov <sergey@apache.org>
Tue, 20 Sep 2011 08:52:30 +0000 (08:52 +0000)
committerSergey Vladimirov <sergey@apache.org>
Tue, 20 Sep 2011 08:52:30 +0000 (08:52 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1173034 13f79535-47bb-0310-9956-ffa450edef68

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

index 5622dc4c08cdcfa4938a5c475c0d7bb271cf1214..812e3b6611552ad6cd75daf2b2184a3478b8f151 100644 (file)
@@ -25,21 +25,14 @@ public final class TableCellDescriptor extends TCAbstractType implements
 {
   public static final int SIZE = 20;
 
-  protected  short field_x_unused;
-
   public TableCellDescriptor()
   {
-    setBrcTop(new BorderCode());
-    setBrcLeft(new BorderCode());
-    setBrcBottom(new BorderCode());
-    setBrcRight(new BorderCode());
-
   }
 
   protected void fillFields(byte[] data, int offset)
   {
     field_1_rgf = LittleEndian.getShort(data, 0x0 + offset);
-    field_x_unused = LittleEndian.getShort(data, 0x2 + offset);
+    field_2_wWidth = LittleEndian.getShort(data, 0x2 + offset);
     setBrcTop(new BorderCode(data, 0x4 + offset));
     setBrcLeft(new BorderCode(data, 0x8 + offset));
     setBrcBottom(new BorderCode(data, 0xc + offset));
@@ -49,7 +42,7 @@ public final class TableCellDescriptor extends TCAbstractType implements
   public void serialize(byte[] data, int offset)
   {
       LittleEndian.putShort(data, 0x0 + offset, field_1_rgf);
-      LittleEndian.putShort(data, 0x2 + offset, field_x_unused);
+      LittleEndian.putShort(data, 0x2 + offset, field_2_wWidth);
       getBrcTop().serialize(data, 0x4 + offset);
       getBrcLeft().serialize(data, 0x8 + offset);
       getBrcBottom().serialize(data, 0xc + offset);
@@ -60,6 +53,7 @@ public final class TableCellDescriptor extends TCAbstractType implements
     throws CloneNotSupportedException
   {
     TableCellDescriptor tc = (TableCellDescriptor)super.clone();
+    tc.setShd( (ShadingDescriptor) getShd().clone() );
     tc.setBrcTop((BorderCode)getBrcTop().clone());
     tc.setBrcLeft((BorderCode)getBrcLeft().clone());
     tc.setBrcBottom((BorderCode)getBrcBottom().clone());