Review comments

This commit is contained in:
jpirnay
2026-04-20 13:28:56 +02:00
parent 3fb9ac9e29
commit 29284c85c9
10 changed files with 129 additions and 127 deletions
+6
View File
@@ -76,6 +76,12 @@ class ChapterXPathIndexer {
* @param paragraphIndex 1-based paragraph index (from section LUT or XPath p[N])
* @param seekHint Optional XHTML byte offset to start scanning from (0 = from beginning).
* Pass Section::getXhtmlByteOffsetForPage() to avoid scanning the whole file.
* @param startParagraphCount Optional seed count (default 0) of direct-body-child <p> elements
* that precede the seekHint position. Should be provided when seekHint > 0 to
* avoid counting from scratch mid-document; callers should pass the paragraph
* index of the LUT entry at the seek page minus 1. If the partial parse with
* this seed doesn't find the target, the function falls back to runParse from
* byte 0 and re-counts with startParagraphCount = 0.
* @return Full-ancestry XPath like "/body/DocFragment[N]/body/div[1]/p[3]", or empty on failure
*/
static std::string findXPathForParagraph(const std::shared_ptr<Epub>& epub, int spineIndex, uint16_t paragraphIndex,