From f99c017a819e01b40783691002520d16bc8f953b Mon Sep 17 00:00:00 2001 From: Sergey Vladimirov Date: Wed, 26 Oct 2011 14:12:07 +0000 Subject: [PATCH] fix dead field structure boundaries git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1189226 13f79535-47bb-0310-9956-ffa450edef68 --- .../poi/hwpf/converter/AbstractWordConverter.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 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 d8331eb82..c7ddf9751 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/converter/AbstractWordConverter.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/converter/AbstractWordConverter.java @@ -341,7 +341,6 @@ public abstract class AbstractWordConverter if ( aliveField != null ) { addToStructures( structures, new Structure( aliveField ) ); - skipUntil = aliveField.getFieldEndOffset() + 1; } else { @@ -349,11 +348,14 @@ public abstract class AbstractWordConverter wordDocument, range, c ); if ( separatorEnd != null ) { - addToStructures( structures, + addToStructures( + structures, new Structure( new DeadFieldBoundaries( c, separatorEnd[0], separatorEnd[1] ), - characterRun.getStartOffset(), - separatorEnd[1] + 1 ) ); + characterRun.getStartOffset(), range + .getCharacterRun( + separatorEnd[1] ) + .getEndOffset() ) ); c = separatorEnd[1]; } }