]> source.dussan.org Git - poi.git/commitdiff
fix dead field structure boundaries
authorSergey Vladimirov <sergey@apache.org>
Wed, 26 Oct 2011 14:12:07 +0000 (14:12 +0000)
committerSergey Vladimirov <sergey@apache.org>
Wed, 26 Oct 2011 14:12:07 +0000 (14:12 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1189226 13f79535-47bb-0310-9956-ffa450edef68

src/scratchpad/src/org/apache/poi/hwpf/converter/AbstractWordConverter.java

index d8331eb8225732852d1a89f3e579565946245f39..c7ddf975181d8ef85f4164c12d6ec4a70748b445 100644 (file)
@@ -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];
                     }
                 }