void (Position resultEndPos, FindResult ijFindResult) { if (ijFindResult.getEndOffset() - 1 <= curPageText.length()) { // "-1" because of beforeFrameStartSymbol in frame resultEndPos.pageNumber = curPageNumber; resultEndPos.symbolOffsetInPage = ijFindResult.getEndOffset() - 1; // "-1" because of beforeFrameStartSymbol in frame } else { resultEndPos.pageNumber = curPageNumber + 1; resultEndPos.symbolOffsetInPage = ijFindResult.getEndOffset() - curPageText.length() - 1; // "-1" because of beforeFrameStartSymbol in frame } }