From 4cef310bd368f705586cf3936ce900eb849c6031 Mon Sep 17 00:00:00 2001 From: Sergey Vladimirov Date: Tue, 5 Jul 2011 03:03:53 +0000 Subject: [PATCH] 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 --- .../src/org/apache/poi/hwpf/model/TextPieceTable.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } -- 2.39.5