From 48dbdca2bdc7163589e0feca0c0ecbb92bf11ee1 Mon Sep 17 00:00:00 2001 From: Sergey Vladimirov Date: Fri, 15 Jul 2011 12:45:44 +0000 Subject: [PATCH] prevent extra text in field git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1147127 13f79535-47bb-0310-9956-ffa450edef68 --- src/scratchpad/src/org/apache/poi/hwpf/model/Field.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/scratchpad/src/org/apache/poi/hwpf/model/Field.java b/src/scratchpad/src/org/apache/poi/hwpf/model/Field.java index 1c9a3b56d3..883d5cf097 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/model/Field.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/model/Field.java @@ -41,7 +41,12 @@ public class Field public int getEndOffset() { - return endPlex.getFcEnd(); + /* + * sometimes plex looks like [100, 2000), where 100 is the position of + * field-end character, and 2000 - some other char position, far away + * from field (not inside). So taking into account only start --sergey + */ + return endPlex.getFcStart() + 1; } public boolean hasSeparator() -- 2.39.5