poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ser...@apache.org
Subject svn commit: r1142764 - /poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/sprm/CharacterSprmUncompressor.java
Date Mon, 04 Jul 2011 19:06:20 GMT
Author: sergey
Date: Mon Jul  4 19:06:20 2011
New Revision: 1142764

URL: http://svn.apache.org/viewvc?rev=1142764&view=rev
Log:
warn and skip wrong type SPRM

Modified:
    poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/sprm/CharacterSprmUncompressor.java

Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/sprm/CharacterSprmUncompressor.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/sprm/CharacterSprmUncompressor.java?rev=1142764&r1=1142763&r2=1142764&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/sprm/CharacterSprmUncompressor.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/sprm/CharacterSprmUncompressor.java Mon
Jul  4 19:06:20 2011
@@ -17,14 +17,19 @@
 
 package org.apache.poi.hwpf.sprm;
 
+import org.apache.poi.hwpf.usermodel.BorderCode;
 import org.apache.poi.hwpf.usermodel.CharacterProperties;
 import org.apache.poi.hwpf.usermodel.DateAndTime;
-import org.apache.poi.hwpf.usermodel.BorderCode;
 import org.apache.poi.hwpf.usermodel.ShadingDescriptor;
 import org.apache.poi.util.LittleEndian;
+import org.apache.poi.util.POILogFactory;
+import org.apache.poi.util.POILogger;
 
 public final class CharacterSprmUncompressor
 {
+    private static final POILogger logger = POILogFactory
+            .getLogger( CharacterSprmUncompressor.class );
+
   public CharacterSprmUncompressor()
   {
   }
@@ -47,6 +52,12 @@ public final class CharacterSprmUncompre
     while (sprmIt.hasNext())
     {
       SprmOperation sprm = sprmIt.next();
+
+      if (sprm.getType() != 2) {
+        logger.log( POILogger.WARN, "Non-CHP SPRM returned by SprmIterator" );
+        continue;
+      }
+
       unCompressCHPOperation(parent, newProperties, sprm);
     }
 



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org


Mime
View raw message