* NOTE! This is an exact copy of PageIterator::IsAtFinalElement with the * change that the variable next is now a ResultIterator instead of a * PageIterator. */
| 530 | * PageIterator. |
| 531 | */ |
| 532 | bool ResultIterator::IsAtFinalElement(PageIteratorLevel level, |
| 533 | PageIteratorLevel element) const { |
| 534 | if (Empty(element)) return true; // Already at the end! |
| 535 | // The result is true if we step forward by element and find we are |
| 536 | // at the the end of the page or at beginning of *all* levels in: |
| 537 | // [level, element). |
| 538 | // When there is more than one level difference between element and level, |
| 539 | // we could for instance move forward one symbol and still be at the first |
| 540 | // word on a line, so we also have to be at the first symbol in a word. |
| 541 | ResultIterator next(*this); |
| 542 | next.Next(element); |
| 543 | if (next.Empty(element)) return true; // Reached the end of the page. |
| 544 | while (element > level) { |
| 545 | element = static_cast<PageIteratorLevel>(element - 1); |
| 546 | if (!next.IsAtBeginningOf(element)) |
| 547 | return false; |
| 548 | } |
| 549 | return true; |
| 550 | } |
| 551 | |
| 552 | /** |
| 553 | * Returns the null terminated UTF-8 encoded text string for the current |
nothing calls this directly
no test coverage detected