summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2020-05-31 21:59:34 +0200
committerTomaž Vajngerl <quikee@gmail.com>2020-07-31 05:30:04 +0200
commit2a394db043293117213fcdf8615d7ce35a515464 (patch)
tree35eab973d2e3cb634f79cf7f76390d8acae42ded
parentvcl: VectorGraphicSearch - support changing search string (diff)
downloadcore-2a394db043293117213fcdf8615d7ce35a515464.tar.gz
core-2a394db043293117213fcdf8615d7ce35a515464.zip
sd: allow to change the search string between searches
Before this was missing, so even with a different search string, it still searched using the old string, which was a bug. Change-Id: I1655cb421e216e30ae593aabd3ead3a2d5c06299 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95461 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> (cherry picked from commit 191288d6a7fb52b31038a21c4e71ee57ffa3bacd) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95947 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> (cherry picked from commit ca214ec3f5b3c65c8d6d335d284b0702f29b4c25) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99816
-rw-r--r--sd/source/ui/view/Outliner.cxx16
1 files changed, 11 insertions, 5 deletions
diff --git a/sd/source/ui/view/Outliner.cxx b/sd/source/ui/view/Outliner.cxx
index 8365fb47a1ff..d0128ac32cc0 100644
--- a/sd/source/ui/view/Outliner.cxx
+++ b/sd/source/ui/view/Outliner.cxx
@@ -854,13 +854,19 @@ bool SdOutliner::SearchAndReplaceOnce(std::vector<sd::SearchSelection>* pSelecti
if (mpImpl->mbCurrentIsVectorGraphic)
{
+ OUString const & rString = mpSearchItem->GetSearchString();
bool bBackwards = mpSearchItem->GetBackward();
- bool bResult = false;
- if (bBackwards)
- bResult = mpImpl->mpVectorGraphicSearch->previous();
- else
- bResult = mpImpl->mpVectorGraphicSearch->next();
+ SearchStartPosition eSearchStartPosition = bBackwards ? SearchStartPosition::End : SearchStartPosition::Begin;
+ bool bResult = mpImpl->mpVectorGraphicSearch->search(rString, eSearchStartPosition);
+
+ if (bResult)
+ {
+ if (bBackwards)
+ bResult = mpImpl->mpVectorGraphicSearch->previous();
+ else
+ bResult = mpImpl->mpVectorGraphicSearch->next();
+ }
if (bResult)
{