sackley     2004/03/01 22:19:18

  Modified:    src/scratchpad/src/org/apache/poi/hwpf/sprm
                        TableSprmUncompressor.java
  Log:
  latest changes
  
  Revision  Changes    Path
  1.2       +10 -12    
jakarta-poi/src/scratchpad/src/org/apache/poi/hwpf/sprm/TableSprmUncompressor.java
  
  Index: TableSprmUncompressor.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-poi/src/scratchpad/src/org/apache/poi/hwpf/sprm/TableSprmUncompressor.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TableSprmUncompressor.java        10 Nov 2003 11:53:41 -0000      1.1
  +++ TableSprmUncompressor.java        2 Mar 2004 06:19:18 -0000       1.2
  @@ -67,25 +67,23 @@
     {
     }
   
  -  public static TableProperties uncompressTAP(TableProperties parent,
  -                                                  byte[] grpprl,
  +  public static TableProperties uncompressTAP(byte[] grpprl,
                                                     int offset)
     {
  -    TableProperties newProperties = null;
  -    try
  -    {
  -      newProperties = (TableProperties) parent.clone();
  -    }
  -    catch (CloneNotSupportedException cnse)
  -    {
  -      throw new RuntimeException("There is no way this exception should happen!!");
  -    }
  +    TableProperties newProperties = new TableProperties();
  +
       SprmIterator sprmIt = new SprmIterator(grpprl, offset);
   
       while (sprmIt.hasNext())
       {
         SprmOperation sprm = (SprmOperation)sprmIt.next();
  -      unCompressTAPOperation(newProperties, sprm);
  +
  +      //TAPXs are actually PAPXs so we have to make sure we are only trying to
  +      //uncompress the right type of sprm.
  +      if (sprm.getType() == SprmOperation.TAP_TYPE)
  +      {
  +        unCompressTAPOperation(newProperties, sprm);
  +      }
       }
   
       return newProperties;
  
  
  

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

Reply via email to