diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2020-05-31 21:59:34 +0200 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2020-06-04 00:44:19 +0200 |
commit | 191288d6a7fb52b31038a21c4e71ee57ffa3bacd (patch) | |
tree | 4be3dda81ce16eded87f557b8cd5226374e9d645 /sd/source/ui | |
parent | 1f8a46ae50c6977add4c4116f114df3a58796be3 (diff) |
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>
Diffstat (limited to 'sd/source/ui')
-rw-r--r-- | sd/source/ui/view/Outliner.cxx | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/sd/source/ui/view/Outliner.cxx b/sd/source/ui/view/Outliner.cxx index 3843cd692872..f8cec9464896 100644 --- a/sd/source/ui/view/Outliner.cxx +++ b/sd/source/ui/view/Outliner.cxx @@ -826,13 +826,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) { |