poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ser...@apache.org
Subject svn commit: r1150622 - /poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/converter/AbstractWordConverter.java
Date Mon, 25 Jul 2011 10:40:03 GMT
Author: sergey
Date: Mon Jul 25 10:40:02 2011
New Revision: 1150622

URL: http://svn.apache.org/viewvc?rev=1150622&view=rev
Log:
correctly hangle out-of-boundaries cases for bookmarks and fields in Word-to-* converters

Modified:
    poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/converter/AbstractWordConverter.java

Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/converter/AbstractWordConverter.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/converter/AbstractWordConverter.java?rev=1150622&r1=1150621&r2=1150622&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/converter/AbstractWordConverter.java
(original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/converter/AbstractWordConverter.java
Mon Jul 25 10:40:02 2011
@@ -318,15 +318,26 @@ public abstract class AbstractWordConver
 
         if ( previous != range.getStartOffset() )
         {
-            Range subrange = new Range( previous, range.getEndOffset(), range )
+            if ( previous > range.getEndOffset() )
             {
-                @Override
-                public String toString()
+                logger.log( POILogger.WARN, "Latest structure in " + range
+                        + " ended after range (" + previous + ")" );
+                return true;
+            }
+
+            if ( previous < range.getEndOffset() )
+            {
+                Range subrange = new Range( previous, range.getEndOffset(),
+                        range )
                 {
-                    return "AfterStructureSubrange " + super.toString();
-                }
-            };
-            processCharacters( document, currentTableLevel, subrange, block );
+                    @Override
+                    public String toString()
+                    {
+                        return "AfterStructureSubrange " + super.toString();
+                    }
+                };
+                processCharacters( document, currentTableLevel, subrange, block );
+            }
             return true;
         }
 



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


Mime
View raw message