When a document had several frames each containing a match, using Find
Previous only ever selected the match in the last frame; earlier frames
were skipped ("Find Next" and "Find All" were fine).
Backward text search walks the node array through SwNodes::GoPrevSection.
Since 691cfd22c6 ("tdf#159565: make sure to
handle leading hidden section correctly", 2024-02-14) that function stops
at the start of the current global section (here, a fly's start node), so
once the search stepped into a frame it could not move back into an
earlier one and got stuck in the last frame reached. GoPrevious got an
opt-in canCrossBoundary flag back then, but GoPrevSection did not.
Give GoPrevSection the same canCrossBoundary flag (default false, so plain
backward moves keep respecting section boundaries), and let the search
iterator in GetNode() opt in: it walks a range that is already bounded by
the PaM's mark, so crossing fly / header / footer / footnote boundaries
within that range is both wanted and safe. This also restores backward
Find across multiple headers, footers and footnotes. Forward search uses
GoNextSection, which was never limited - which is why Find Next and Find
All kept working.
Signed-off-by: Mike Kaganski <mike.kaganski@collabora.com>
Change-Id: I0c0971013d2fab19dac1de1e252586d7ea554c2b
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/7060
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
(cherry picked from commit 051e00083683db002942b94d0323c5d8fd13e6d4)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208242
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins