From d7557a802bbea00727b5c220592be88fa335240c Mon Sep 17 00:00:00 2001 From: Sergey Vladimirov Date: Tue, 12 Jul 2011 00:38:07 +0000 Subject: [PATCH] add type constants and extends toString() for SprmOperation git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1145406 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/poi/hwpf/sprm/SprmOperation.java | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/scratchpad/src/org/apache/poi/hwpf/sprm/SprmOperation.java b/src/scratchpad/src/org/apache/poi/hwpf/sprm/SprmOperation.java index 6465f3b32..2c2c22725 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/sprm/SprmOperation.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/sprm/SprmOperation.java @@ -43,6 +43,9 @@ public final class SprmOperation final static private short SPRM_LONG_TABLE = (short) 0xd608; public static final int TYPE_PAP = 1; + public static final int TYPE_CHP = 2; + public static final int TYPE_PIC = 3; + public static final int TYPE_SEP = 4; public static final int TYPE_TAP = 5; @Deprecated @@ -183,6 +186,18 @@ public final class SprmOperation @Override public String toString() { - return "[SPRM] (0x" + Integer.toHexString( _value & 0xffff ) + ")"; + StringBuilder stringBuilder = new StringBuilder(); + stringBuilder.append( "[SPRM] (0x" ); + stringBuilder.append( Integer.toHexString( _value & 0xffff ) ); + stringBuilder.append( "): " ); + try + { + stringBuilder.append( getOperand() ); + } + catch ( Exception exc ) + { + stringBuilder.append( "(error)" ); + } + return stringBuilder.toString(); } }