]> source.dussan.org Git - poi.git/commitdiff
hwpf: ignore ArrayIndexOutOfBoundsException in TableSprmUncompressor
authorMaxim Valyanskiy <maxcom@apache.org>
Thu, 30 Jun 2011 11:46:27 +0000 (11:46 +0000)
committerMaxim Valyanskiy <maxcom@apache.org>
Thu, 30 Jun 2011 11:46:27 +0000 (11:46 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1141490 13f79535-47bb-0310-9956-ffa450edef68

src/scratchpad/src/org/apache/poi/hwpf/sprm/TableSprmUncompressor.java

index 8f9455d7b63d93673f41af0bf8cf0b10b2829874..342c68e7b71a3494a8620d15be131efb3064d784 100644 (file)
@@ -21,10 +21,14 @@ import org.apache.poi.hwpf.usermodel.BorderCode;
 import org.apache.poi.hwpf.usermodel.TableCellDescriptor;
 import org.apache.poi.hwpf.usermodel.TableProperties;
 import org.apache.poi.util.LittleEndian;
+import org.apache.poi.util.POILogFactory;
+import org.apache.poi.util.POILogger;
 
 public final class TableSprmUncompressor
   extends SprmUncompressor
 {
+  private static final POILogger logger = POILogFactory.getLogger( TableSprmUncompressor.class );
+
   public TableSprmUncompressor()
   {
   }
@@ -44,7 +48,16 @@ public final class TableSprmUncompressor
       //uncompress the right type of sprm.
       if (sprm.getType() == SprmOperation.TAP_TYPE)
       {
-        unCompressTAPOperation(newProperties, sprm);
+        try {
+            unCompressTAPOperation(newProperties, sprm);
+        } catch (ArrayIndexOutOfBoundsException ex) {
+              logger.log(
+                      POILogger.ERROR,
+                      "Unable to apply SPRM operation '"
+                              + sprm.getOperation() + "': ",
+                      ex
+              );
+        }
       }
     }