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