From: Sergey Vladimirov Date: Tue, 5 Jul 2011 03:03:53 +0000 (+0000) Subject: sometimes there is a lag between text pieces; for example X-Git-Tag: REL_3_8_BETA4~319 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=4cef310bd368f705586cf3936ce900eb849c6031;p=poi.git sometimes there is a lag between text pieces; for example [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 --- diff --git a/src/scratchpad/src/org/apache/poi/hwpf/model/TextPieceTable.java b/src/scratchpad/src/org/apache/poi/hwpf/model/TextPieceTable.java index 43bfcf8120..59720f1dde 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/model/TextPieceTable.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/model/TextPieceTable.java @@ -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; }