]> source.dussan.org Git - poi.git/commitdiff
Patch from Sergey from bug #51292 - Additional HWPF Table Cell descriptor values
authorNick Burch <nick@apache.org>
Tue, 31 May 2011 14:21:32 +0000 (14:21 +0000)
committerNick Burch <nick@apache.org>
Tue, 31 May 2011 14:21:32 +0000 (14:21 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1129690 13f79535-47bb-0310-9956-ffa450edef68

src/documentation/content/xdocs/status.xml
src/scratchpad/src/org/apache/poi/hwpf/model/types/TCAbstractType.java
src/types/definitions/tc_type.xml

index 4aa14c64b6e2fc933cb769c5a9862335fff3f0c1..730555cbb98bc011ea531e92c202071f2e295f45 100644 (file)
@@ -33,6 +33,9 @@
     </developers>
 
     <changes>
+        <release version="3.8-beta4" date="2011-??-??">
+           <action dev="poi-developers" type="add">51292 - Additional HWPF Table Cell Descriptor values</action>
+        </release>
         <release version="3.8-beta3" date="2011-??-??">
            <action dev="poi-developers" type="fix">51098 - Correct calculate image width/height, if image fits into one cell</action>
            <action dev="poi-developers" type="fix">47147 - Correct extra paragraphs from XWPF Table Cells</action>
index 68b4a108c381db36337b114dc80a86cad9e5b872..a0cd02c89f1eb0b538c07518c6a6dd1a99f0ed6e 100644 (file)
 package org.apache.poi.hwpf.model.types;
 
 
+import org.apache.poi.hdf.model.hdftypes.HDFType;
+import org.apache.poi.hwpf.usermodel.BorderCode;
 import org.apache.poi.util.BitField;
 import org.apache.poi.util.BitFieldFactory;
 import org.apache.poi.util.LittleEndian;
-import org.apache.poi.hdf.model.hdftypes.HDFType;
-import org.apache.poi.hwpf.usermodel.*;
 
 /**
  * Table Cell Descriptor.
@@ -32,16 +32,19 @@ import org.apache.poi.hwpf.usermodel.*;
  * @author S. Ryan Ackley
  */
 public abstract class TCAbstractType implements HDFType {
-
     protected  short field_1_rgf;
-        private static BitField  fFirstMerged = BitFieldFactory.getInstance(0x0001);
-        private static BitField  fMerged = BitFieldFactory.getInstance(0x0002);
-        private static BitField  fVertical = BitFieldFactory.getInstance(0x0004);
-        private static BitField  fBackward = BitFieldFactory.getInstance(0x0008);
-        private static BitField  fRotateFont = BitFieldFactory.getInstance(0x0010);
-        private static BitField  fVertMerge = BitFieldFactory.getInstance(0x0020);
-        private static BitField  fVertRestart = BitFieldFactory.getInstance(0x0040);
-        private static BitField  vertAlign = BitFieldFactory.getInstance(0x0180);
+    private static BitField fFirstMerged = BitFieldFactory.getInstance(0x0001);
+    private static BitField fMerged = BitFieldFactory.getInstance(0x0002);
+    private static BitField fVertical = BitFieldFactory.getInstance(0x0004);
+    private static BitField fBackward = BitFieldFactory.getInstance(0x0008);
+    private static BitField fRotateFont = BitFieldFactory.getInstance(0x0010);
+    private static BitField fVertMerge = BitFieldFactory.getInstance(0x0020);
+    private static BitField fVertRestart = BitFieldFactory.getInstance(0x0040);
+    private static BitField vertAlign = BitFieldFactory.getInstance(0x0180);
+    private static BitField ftsWidth = new BitField(0x0E00);
+    private static BitField fFitText = new BitField(0x1000);
+    private static BitField fNoWrap = new BitField(0x2000);
+    private static BitField fUnused = new BitField(0xC000);
     protected  short field_2_unused;
     protected  BorderCode field_3_brcTop;
     protected  BorderCode field_4_brcLeft;
@@ -91,6 +94,10 @@ public abstract class TCAbstractType implements HDFType {
         buffer.append("         .fVertMerge               = ").append(isFVertMerge()).append('\n');
         buffer.append("         .fVertRestart             = ").append(isFVertRestart()).append('\n');
         buffer.append("         .vertAlign                = ").append(getVertAlign()).append('\n');
+        buffer.append("         .ftsWidth                 = ").append(getFtsWidth()).append('\n');
+        buffer.append("         .fFitText                 = ").append(isFFitText()).append('\n');
+        buffer.append("         .fNoWrap                  = ").append(isFNoWrap()).append('\n');
+        buffer.append("         .fUnused                  = ").append(getFUnused()).append('\n');
 
         buffer.append("    .unused               = ");
         buffer.append(" (").append(getUnused()).append(" )\n");
@@ -358,6 +365,67 @@ public abstract class TCAbstractType implements HDFType {
      */
     public byte getVertAlign()
     {
-        return ( byte )vertAlign.getValue(field_1_rgf);
+        return (byte)vertAlign.getValue(field_1_rgf);
+    }
+
+    /**
+     * Sets the ftsWidth field value
+     */
+    public void setFtsWidth(byte value) {
+       field_1_rgf = (short)ftsWidth.setValue(field_1_rgf, value);
+    }
+
+    /**
+     * @return the ftsWidth field value
+     */
+    public byte getFtsWidth() {
+       return (byte)ftsWidth.getValue(field_1_rgf);
+    }
+    
+    /**
+     * Sets the fFitText field value.
+     * 
+     */
+    public void setFFitText(boolean value) {
+       field_1_rgf = (short)fFitText.setBoolean(field_1_rgf, value);
+    }
+
+    /**
+     * @return  the fFitText field value.
+     */
+    public boolean isFFitText() {
+       return fFitText.isSet(field_1_rgf);
+    }
+    
+    /**
+     * Sets the fNoWrap field value.
+     * 
+     */
+    public void setFNoWrap(boolean value) {
+       field_1_rgf = (short)fNoWrap.setBoolean(field_1_rgf, value);
+    }
+
+    /**
+     * 
+     * @return  the fNoWrap field value.
+     */
+    public boolean isFNoWrap() {
+       return fNoWrap.isSet(field_1_rgf);
+    }
+    
+    /**
+     * Sets the fUnused field value.
+     * 
+     */
+    public void setFUnused(byte value) {
+       field_1_rgf = (short)fUnused.setValue(field_1_rgf, value);
+    }
+
+    /**
+     * 
+     * @return  the fUnused field value.
+     */
+    public byte getFUnused() {
+       return ( byte )fUnused.getValue(field_1_rgf);
     }
 }
index 6a7707320c0d55dbb5ebf28ed15a45fe5aa983e4..47ee8a7f323a7ea99f6a8d64796956756580ed11 100644 (file)
         <bit number="5" mask="0x0020" name="fVertMerge"/>
         <bit number="6" mask="0x0040" name="fVertRestart"/>
         <bit number="7" mask="0x0180" name="vertAlign"/>
+        <bit number="8" mask="0x0E00" name="ftsWidth"/>
+        <bit number="9" mask="0x1000" name="fFitText"/>
+        <bit number="10" mask="0x2000" name="fNoWrap"/>
+        <bit number="11" mask="0xC000" name="fUnused"/>
       </field>
       <field type="short" size="2" name="unused"/>
       <field type="BorderCode" size="4" name="brcTop"/>