poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ser...@apache.org
Subject svn commit: r1142859 - /poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/sprm/SprmOperation.java
Date Tue, 05 Jul 2011 00:46:42 GMT
Author: sergey
Date: Tue Jul  5 00:46:42 2011
New Revision: 1142859

URL: http://svn.apache.org/viewvc?rev=1142859&view=rev
Log:
add SprmOperation.toString() for debug purposes

Modified:
    poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/sprm/SprmOperation.java

Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/sprm/SprmOperation.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/sprm/SprmOperation.java?rev=1142859&r1=1142858&r2=1142859&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/sprm/SprmOperation.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/sprm/SprmOperation.java Tue Jul  5 00:46:42
2011
@@ -40,6 +40,7 @@ public final class SprmOperation
   final static public int PAP_TYPE = 1;
   final static public int TAP_TYPE = 5;
 
+  private short _value;
   private int _type;
   private int _operation;
   private int _gOffset;
@@ -51,14 +52,14 @@ public final class SprmOperation
   {
     _grpprl = grpprl;
 
-    short sprmStart = LittleEndian.getShort(grpprl, offset);
+    _value = LittleEndian.getShort(grpprl, offset);
 
     _gOffset = offset + 2;
 
-    _operation = OP_BITFIELD.getValue(sprmStart);
-    _type = TYPE_BITFIELD.getValue(sprmStart);
-    _sizeCode = SIZECODE_BITFIELD.getValue(sprmStart);
-    _size = initSize(sprmStart);
+    _operation = OP_BITFIELD.getValue(_value);
+    _type = TYPE_BITFIELD.getValue(_value);
+    _sizeCode = SIZECODE_BITFIELD.getValue(_value);
+    _size = initSize(_value);
   }
 
   public static int getOperationFromOpcode(short opcode)
@@ -159,4 +160,10 @@ public final class SprmOperation
         throw new IllegalArgumentException("SPRM contains an invalid size code");
     }
   }
+
+    @Override
+    public String toString()
+    {
+        return "[SPRM] (0x" + Integer.toHexString( _value & 0xffff ) + ")";
+    }
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org


Mime
View raw message