aboutsummaryrefslogtreecommitdiffstats
path: root/src/contrib
diff options
context:
space:
mode:
Diffstat (limited to 'src/contrib')
-rw-r--r--src/contrib/src/org/apache/poi/contrib/poibrowser/Codec.java20
-rw-r--r--src/contrib/src/org/apache/poi/contrib/poibrowser/POIBrowser.java2
-rw-r--r--src/contrib/src/org/apache/poi/contrib/poibrowser/PropertySetDescriptorRenderer.java4
3 files changed, 21 insertions, 5 deletions
diff --git a/src/contrib/src/org/apache/poi/contrib/poibrowser/Codec.java b/src/contrib/src/org/apache/poi/contrib/poibrowser/Codec.java
index 9b7d21ca0f..325b0fe077 100644
--- a/src/contrib/src/org/apache/poi/contrib/poibrowser/Codec.java
+++ b/src/contrib/src/org/apache/poi/contrib/poibrowser/Codec.java
@@ -143,6 +143,22 @@ public class Codec
/**
+ * <p>Converts a short value (16-bit) into its hexadecimal
+ * notation.</p>
+ */
+ public static String hexEncode(final short s)
+ {
+ StringBuffer sb = new StringBuffer(4);
+ sb.append((char) hexval[(s & 0xF000) >> 12]);
+ sb.append((char) hexval[(s & 0x0F00) >> 8]);
+ sb.append((char) hexval[(s & 0x00F0) >> 4]);
+ sb.append((char) hexval[(s & 0x000F) >> 0]);
+ return sb.toString();
+ }
+
+
+
+ /**
* <p>Converts an int value (32-bit) into its hexadecimal
* notation.</p>
*/
@@ -169,8 +185,8 @@ public class Codec
public static String hexEncode(final long l)
{
StringBuffer sb = new StringBuffer(16);
- sb.append((l & 0xFFFFFFFF00000000L) >> 32);
- sb.append((l & 0x00000000FFFFFFFFL) >> 0);
+ sb.append(hexEncode((int) (l & 0xFFFFFFFF00000000L) >> 32));
+ sb.append(hexEncode((int) (l & 0x00000000FFFFFFFFL) >> 0));
return sb.toString();
}
diff --git a/src/contrib/src/org/apache/poi/contrib/poibrowser/POIBrowser.java b/src/contrib/src/org/apache/poi/contrib/poibrowser/POIBrowser.java
index 5e1cb1394a..1ca8d8342c 100644
--- a/src/contrib/src/org/apache/poi/contrib/poibrowser/POIBrowser.java
+++ b/src/contrib/src/org/apache/poi/contrib/poibrowser/POIBrowser.java
@@ -159,7 +159,7 @@ public class POIBrowser extends JFrame
new PropertySetDescriptorRenderer());
treeUI.setCellRenderer(etcr);
setSize(600, 450);
- setTitle("POI Browser 0.07");
+ setTitle("POI Browser 0.08");
setVisible(true);
}
diff --git a/src/contrib/src/org/apache/poi/contrib/poibrowser/PropertySetDescriptorRenderer.java b/src/contrib/src/org/apache/poi/contrib/poibrowser/PropertySetDescriptorRenderer.java
index bb2750ab2f..a425c1372a 100644
--- a/src/contrib/src/org/apache/poi/contrib/poibrowser/PropertySetDescriptorRenderer.java
+++ b/src/contrib/src/org/apache/poi/contrib/poibrowser/PropertySetDescriptorRenderer.java
@@ -94,9 +94,9 @@ public class PropertySetDescriptorRenderer extends DocumentDescriptorRenderer
text.setFont(new Font("Monospaced", Font.PLAIN, 10));
text.append(renderAsString(d));
text.append("\nByte order: " +
- Codec.hexEncode(ps.getByteOrder()));
+ Codec.hexEncode((short) ps.getByteOrder()));
text.append("\nFormat: " +
- Codec.hexEncode(ps.getFormat()));
+ Codec.hexEncode((short) ps.getFormat()));
text.append("\nOS version: " +
Codec.hexEncode(ps.getOSVersion()));
text.append("\nClass ID: " +