]> source.dussan.org Git - poi.git/commitdiff
sometimes there is a lag between text pieces; for example
authorSergey Vladimirov <sergey@apache.org>
Tue, 5 Jul 2011 03:03:53 +0000 (03:03 +0000)
committerSergey Vladimirov <sergey@apache.org>
Tue, 5 Jul 2011 03:03:53 +0000 (03:03 +0000)
[0; 2), [2; 4), [6,8)
previous implementation correctly calculates next(2)=>2, but incorrectly next(4)=>4 (need to be 6).

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1142881 13f79535-47bb-0310-9956-ffa450edef68

src/scratchpad/src/org/apache/poi/hwpf/model/TextPieceTable.java

index 43bfcf8120afc26c6c61b2b12a955eac8f414315..59720f1ddec53eeccc5ef95e18fb46a75309efd0 100644 (file)
@@ -240,7 +240,7 @@ public class TextPieceTable implements CharIndexTranslator {
         for(TextPiece tp : _textPiecesFCOrder) {
                        int pieceStart = tp.getPieceDescriptor().getFilePosition();
 
-            if (bytePos > pieceStart + tp.bytesLength()) {
+            if (bytePos >= pieceStart + tp.bytesLength()) {
                 continue;
             }