diff options
author | Sergey Vladimirov <sergey@apache.org> | 2011-08-22 11:07:06 +0000 |
---|---|---|
committer | Sergey Vladimirov <sergey@apache.org> | 2011-08-22 11:07:06 +0000 |
commit | fd7ecac05205738442626de215254f55399d23c4 (patch) | |
tree | 4d40e95c340e216c8b913d43be348f67b4066f9e | |
parent | e342efb4ab7d49d974145c590fd5ffe0cf2acb6f (diff) | |
download | poi-fd7ecac05205738442626de215254f55399d23c4.tar.gz poi-fd7ecac05205738442626de215254f55399d23c4.zip |
handling case with overlapping bookmarks and fields
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1160201 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | src/scratchpad/src/org/apache/poi/hwpf/converter/AbstractWordConverter.java | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/scratchpad/src/org/apache/poi/hwpf/converter/AbstractWordConverter.java b/src/scratchpad/src/org/apache/poi/hwpf/converter/AbstractWordConverter.java index 6f35f1d6df..5da89f3afe 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/converter/AbstractWordConverter.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/converter/AbstractWordConverter.java @@ -81,6 +81,13 @@ public abstract class AbstractWordConverter { 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 AbstractWordConverter 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; |