diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2020-05-29 23:52:50 +0200 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2020-06-03 13:26:40 +0200 |
commit | 83d27791fed75941c75d3cc571c3d5cf27d14e8c (patch) | |
tree | 4fa75b80e322791796af560d110deebdd545d688 /include/vcl/VectorGraphicSearch.hxx | |
parent | 997a504f33bbd43c02a96a2a593a03e58bd3b72c (diff) |
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>
Diffstat (limited to 'include/vcl/VectorGraphicSearch.hxx')
-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(); |