]> source.dussan.org Git - poi.git/commitdiff
allow bad properties parsing
authorSergey Vladimirov <sergey@apache.org>
Thu, 7 Jul 2011 11:04:59 +0000 (11:04 +0000)
committerSergey Vladimirov <sergey@apache.org>
Thu, 7 Jul 2011 11:04:59 +0000 (11:04 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1143758 13f79535-47bb-0310-9956-ffa450edef68

src/scratchpad/src/org/apache/poi/hwpf/model/PropertyNode.java

index 251458e3f6466a8d5c38221b8ef236c22be20670..187e3db188dcc8173d9a9d943519e29501b00300 100644 (file)
@@ -57,10 +57,14 @@ public abstract class PropertyNode<T extends PropertyNode<T>>  implements Compar
          _cpStart = 0;
       }
 
-      if ( fcStart > fcEnd )
-          throw new IllegalArgumentException( "fcStart (" + fcStart
-                  + ") > fcEnd (" + fcEnd + ")" );
-  }
+        if ( _cpEnd < _cpStart )
+        {
+            _logger.log( POILogger.WARN, "A property claimed to end (" + _cpEnd
+                    + ") before start! "
+                    + "Resetting end to start, and hoping for the best" );
+            _cpEnd = _cpStart;
+        }
+    }
 
   /**
    * @return The start offset of this property's text.