You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by se...@apache.org on 2011/08/22 13:07:06 UTC

svn commit: r1160201 - /poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/converter/AbstractWordConverter.java

Author: sergey
Date: Mon Aug 22 11:07:06 2011
New Revision: 1160201

URL: http://svn.apache.org/viewvc?rev=1160201&view=rev
Log:
handling case with overlapping bookmarks and fields

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=1160201&r1=1160200&r2=1160201&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 Aug 22 11:07:06 2011
@@ -81,6 +81,13 @@ public abstract class AbstractWordConver
         {
             return start < o.start ? -1 : start == o.start ? 0 : 1;
         }
+
+        @Override
+        public String toString()
+        {
+            return "Structure [" + start + "; " + end + "): "
+                    + structure.toString();
+        }
     }
 
     private static final byte BEL_MARK = 7;
@@ -116,8 +123,9 @@ public abstract class AbstractWordConver
                 return;
             }
 
-            if ( ( another.start > structure.start && another.end <= structure.end )
-                    || ( another.start >= structure.start && another.end < structure.end ) )
+            if ( ( structure.start < another.start && another.start < structure.end )
+                    || ( structure.start < another.start && another.end <= structure.end )
+                    || ( structure.start <= another.start && another.end < structure.end ) )
             {
                 iterator.remove();
                 continue;



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