vhardy      02/03/04 04:29:04

  Modified:    sources/org/apache/batik/transcoder/wmf/tosvg
                        WMFRecordStore.java
  Log:
  Fix by Luan O'Caroll
  
  Revision  Changes    Path
  1.2       +14 -11    
xml-batik/sources/org/apache/batik/transcoder/wmf/tosvg/WMFRecordStore.java
  
  Index: WMFRecordStore.java
  ===================================================================
  RCS file: 
/home/cvs/xml-batik/sources/org/apache/batik/transcoder/wmf/tosvg/WMFRecordStore.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- WMFRecordStore.java       16 Mar 2001 22:54:59 -0000      1.1
  +++ WMFRecordStore.java       4 Mar 2002 12:29:04 -0000       1.2
  @@ -18,29 +18,30 @@
    * Reads a WMF file, including an Aldus Placable Metafile Header.
    *
    * @author <a href="mailto:[EMAIL PROTECTED]";>Luan O'Carroll</a>
  - * @version $Id: WMFRecordStore.java,v 1.1 2001/03/16 22:54:59 vhardy Exp $
  + * @version $Id: WMFRecordStore.java,v 1.2 2002/03/04 12:29:04 vhardy Exp $
    */
   public class WMFRecordStore extends RecordStore implements WMFConstants{
   
  +    private byte js2B[] = new byte[ 2 ];
  +    private byte js4B[] = new byte[ 4 ];
  +
       public WMFRecordStore(){
       }
   
       private short readShort( DataInputStream is  ) throws IOException{
  -        byte js[] = new byte[ 2 ];
  -        is.read( js );
  -        int iTemp = ((0xff) & js[ 1 ] ) << 8;
  +        is.read( js2B );
  +        int iTemp = ((0xff) & js2B[ 1 ] ) << 8;
           short i = (short)(0xffff & iTemp);
  -        i |= ((0xff) & js[ 0 ] );
  +        i |= ((0xff) & js2B[ 0 ] );
           return i;
       }
   
       private int readInt( DataInputStream is  ) throws IOException {
  -        byte js[] = new byte[ 4 ];
  -        is.read( js );
  -        int i = ((0xff) & js[ 3 ] ) << 24;
  -        i |= ((0xff) & js[ 2 ] ) << 16;
  -        i |= ((0xff) & js[ 1 ] ) << 8;
  -        i |= ((0xff) & js[ 0 ] );
  +        is.read( js4B );
  +        int i = ((0xff) & js4B[ 3 ] ) << 24;
  +        i |= ((0xff) & js4B[ 2 ] ) << 16;
  +        i |= ((0xff) & js4B[ 1 ] ) << 8;
  +        i |= ((0xff) & js4B[ 0 ] );
           return i;
       }
   
  @@ -244,6 +245,8 @@
                       int width = readShort( is );
                       int colorref =  readInt( is );
                       int height = readShort( is );
  +                    for ( int j = 5; j < recSize; j++ )
  +                       readShort( is );
   
                       int red = colorref & 0xff;
                       int green = ( colorref & 0xff00 ) >> 8;
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to