diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2020-05-29 23:52:50 +0200 |
---|---|---|
committer | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2020-07-30 15:07:11 +0200 |
commit | 97cdbd4f3719f10942865db01efb7e9b62db6bfa (patch) | |
tree | b32e0f9274b1b8fb5e608d5ec571bfd5c84450ed /include | |
parent | vcl: add "previous" search to VectorGraphicSearch (diff) | |
download | core-97cdbd4f3719f10942865db01efb7e9b62db6bfa.tar.gz core-97cdbd4f3719f10942865db01efb7e9b62db6bfa.zip |
vcl: add search start position support for VectorGraphicSearch
By default we start at the begin of the page, but with this change
make it possible to start at the end. This makes it possible to
search in the backwards direction (set the start position at to
the end and search with "previous").
Change-Id: I78fb1461b86bf9eab2f91c3b9a81cbb5c6557332
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95382
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
(cherry picked from commit 83d27791fed75941c75d3cc571c3d5cf27d14e8c)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95930
Tested-by: Tomaž Vajngerl <quikee@gmail.com>
(cherry picked from commit d7e75f660b3cdfa43ffa572f7a150263b7ed27e8)
Diffstat (limited to 'include')
-rw-r--r-- | include/vcl/VectorGraphicSearch.hxx | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/include/vcl/VectorGraphicSearch.hxx b/include/vcl/VectorGraphicSearch.hxx index a00c212ad61c..b67c63a844d8 100644 --- a/include/vcl/VectorGraphicSearch.hxx +++ b/include/vcl/VectorGraphicSearch.hxx @@ -21,6 +21,12 @@ class SearchContext; +enum class SearchStartPosition +{ + Begin, + End +}; + class VCL_DLLPUBLIC VectorGraphicSearch final { private: @@ -29,12 +35,14 @@ private: Graphic maGraphic; std::unique_ptr<SearchContext> mpSearchContext; - bool searchPDF(std::shared_ptr<VectorGraphicData> const& rData, OUString const& rSearchString); + bool searchPDF(std::shared_ptr<VectorGraphicData> const& rData, OUString const& rSearchString, + SearchStartPosition eStartPosition); public: VectorGraphicSearch(Graphic const& rGraphic); ~VectorGraphicSearch(); - bool search(OUString const& rSearchString); + bool search(OUString const& rSearchString, + SearchStartPosition eStartPosition = SearchStartPosition::Begin); basegfx::B2DSize pageSize(); bool next(); bool previous(); |