diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2020-06-04 18:26:58 +0200 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2020-06-10 08:11:41 +0200 |
commit | 456116d97b66703e23055b83ded5d87ed85c728d (patch) | |
tree | 54c5247f4921a6c82db38229fafdab495114cf0a /include | |
parent | 3e20ddab50de57f8a4f915791bbb56710c4936e3 (diff) |
sd: support match case, match whole word for PDF search
THis adds support for match case and match whole word to the
VectorGraphicSearch + tests.
It uses the new options in PDF seearch in Draw/Impress.
Change-Id: I20a6382c22bf01a5a021c8bae1ff78861419c0ef
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95530
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
(cherry picked from commit 112d8113388513d9c6b317e828f5d373b4a54330)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95950
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/vcl/VectorGraphicSearch.hxx | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/include/vcl/VectorGraphicSearch.hxx b/include/vcl/VectorGraphicSearch.hxx index c9faaa51f1c9..4601a1f5ac1d 100644 --- a/include/vcl/VectorGraphicSearch.hxx +++ b/include/vcl/VectorGraphicSearch.hxx @@ -25,6 +25,28 @@ enum class SearchStartPosition End }; +struct VCL_DLLPUBLIC VectorGraphicSearchOptions final +{ + SearchStartPosition meStartPosition; + bool mbMatchCase; + bool mbMatchWholeWord; + + VectorGraphicSearchOptions() + : meStartPosition(SearchStartPosition::Begin) + , mbMatchCase(false) + , mbMatchWholeWord(false) + { + } + + VectorGraphicSearchOptions(SearchStartPosition eStartPosition, bool bMatchCase, + bool bMatchWholeWord) + : meStartPosition(eStartPosition) + , mbMatchCase(bMatchCase) + , mbMatchWholeWord(bMatchWholeWord) + { + } +}; + class VCL_DLLPUBLIC VectorGraphicSearch final { private: @@ -38,7 +60,7 @@ public: VectorGraphicSearch(Graphic const& rGraphic); ~VectorGraphicSearch(); bool search(OUString const& rSearchString, - SearchStartPosition eStartPosition = SearchStartPosition::Begin); + VectorGraphicSearchOptions const& rOptions = VectorGraphicSearchOptions()); basegfx::B2DSize pageSize(); bool next(); bool previous(); |