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
This commit is contained in:
Sergey Vladimirov 2011-07-05 03:03:53 +00:00
parent 9b69954212
commit 2cbeb04781

View 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;
}