]> source.dussan.org Git - poi.git/commitdiff
Bug fix for writing out the mask for BitMask properties
authorNick Burch <nick@apache.org>
Wed, 12 Apr 2006 17:59:03 +0000 (17:59 +0000)
committerNick Burch <nick@apache.org>
Wed, 12 Apr 2006 17:59:03 +0000 (17:59 +0000)
git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@393549 13f79535-47bb-0310-9956-ffa450edef68

src/scratchpad/src/org/apache/poi/hslf/record/StyleTextPropAtom.java

index 148227136dd132226980c9e220b321dd05cd5567..8ef16c9164225df247c70de06aba9c53cc730004 100644 (file)
@@ -447,7 +447,7 @@ public class StyleTextPropAtom extends RecordAtom
                        int mask = 0;
                        for(int i=0; i<textPropList.size(); i++) {
                                TextProp textProp = (TextProp)textPropList.get(i);
-                               mask += textProp.getMask();
+                               mask += textProp.getWriteMask();
                        }
                        writeLittleEndian(mask,o);
 
@@ -504,6 +504,11 @@ public class StyleTextPropAtom extends RecordAtom
                 *  that indicates that this text property is present.
                 */
                public int getMask() { return maskInHeader; }
+               /**
+                * Get the mask that's used at write time. Only differs from
+                *  the result of getMask() for the mask based properties 
+                */
+               public int getWriteMask() { return getMask(); }
 
                /**
                 * Fetch the value of the text property (meaning is specific to
@@ -553,7 +558,15 @@ public class StyleTextPropAtom extends RecordAtom
                        subPropMasks = new int[subPropNames.length];
                        subPropMatches = new boolean[subPropNames.length];
                }
-
+               
+               /**
+                * As we're purely mask based, just set flags for stuff
+                *  that is set
+                */
+               public int getWriteMask() {
+                       return dataValue;
+               }
+               
                /**
                 * Set the value of the text property, and recompute the sub
                 *  properties based on it