poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kl...@apache.org
Subject cvs commit: jakarta-poi/src/contrib/src/org/apache/poi/contrib/poibrowser Codec.java POIBrowser.java PropertySetDescriptorRenderer.java
Date Sat, 22 Feb 2003 13:39:24 GMT
klute       2003/02/22 05:39:24

  Modified:    src/contrib/src/org/apache/poi/contrib/poibrowser Codec.java
                        POIBrowser.java PropertySetDescriptorRenderer.java
  Log:
  Small bug fixes with respect to hex decoding.
  
  Revision  Changes    Path
  1.3       +19 -3     jakarta-poi/src/contrib/src/org/apache/poi/contrib/poibrowser/Codec.java
  
  Index: Codec.java
  ===================================================================
  RCS file: /home/cvs/jakarta-poi/src/contrib/src/org/apache/poi/contrib/poibrowser/Codec.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Codec.java	17 Jul 2002 16:23:21 -0000	1.2
  +++ Codec.java	22 Feb 2003 13:39:24 -0000	1.3
  @@ -143,6 +143,22 @@
   
   
       /**
  +     * <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 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();
       }
   
  
  
  
  1.5       +2 -2      jakarta-poi/src/contrib/src/org/apache/poi/contrib/poibrowser/POIBrowser.java
  
  Index: POIBrowser.java
  ===================================================================
  RCS file: /home/cvs/jakarta-poi/src/contrib/src/org/apache/poi/contrib/poibrowser/POIBrowser.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- POIBrowser.java	17 Jul 2002 16:23:21 -0000	1.4
  +++ POIBrowser.java	22 Feb 2003 13:39:24 -0000	1.5
  @@ -159,7 +159,7 @@
                         new PropertySetDescriptorRenderer());
           treeUI.setCellRenderer(etcr);
           setSize(600, 450);
  -        setTitle("POI Browser 0.07");
  +        setTitle("POI Browser 0.08");
           setVisible(true);
       }
   
  
  
  
  1.4       +3 -3      jakarta-poi/src/contrib/src/org/apache/poi/contrib/poibrowser/PropertySetDescriptorRenderer.java
  
  Index: PropertySetDescriptorRenderer.java
  ===================================================================
  RCS file: /home/cvs/jakarta-poi/src/contrib/src/org/apache/poi/contrib/poibrowser/PropertySetDescriptorRenderer.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- PropertySetDescriptorRenderer.java	17 Jul 2002 16:23:21 -0000	1.3
  +++ PropertySetDescriptorRenderer.java	22 Feb 2003 13:39:24 -0000	1.4
  @@ -94,9 +94,9 @@
           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: " +
  
  
  

Mime
View raw message