diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-01-14 17:26:00 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-01-14 19:38:57 +0100 |
commit | de0db2872fbeb65067142c216220b86990bd661f (patch) | |
tree | fa16a777150c47d0df9dd45b769643e61094d7eb /sd | |
parent | 4505998dd9271ab0ca55ffe38642a5fa5a316320 (diff) |
sd: use ScopeGuard in Outliner::SearchAndReplaceAll()
So the flag will be reset on early return as well.
(cherry picked from commit 6372080cd396a7e8608806a35a1be68d288b8fda)
Conflicts:
sd/source/ui/view/Outliner.cxx
Change-Id: Ib086ec4a02dda291a0291a8ac40660c16de0fbf6
Diffstat (limited to 'sd')
-rw-r--r-- | sd/source/ui/view/Outliner.cxx | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sd/source/ui/view/Outliner.cxx b/sd/source/ui/view/Outliner.cxx index 76b1272fd0d0..ca625c89284e 100644 --- a/sd/source/ui/view/Outliner.cxx +++ b/sd/source/ui/view/Outliner.cxx @@ -80,6 +80,7 @@ #include <editeng/editerr.hxx> #include <LibreOfficeKit/LibreOfficeKitEnums.h> #include <comphelper/string.hxx> +#include <comphelper/scopeguard.hxx> using namespace ::com::sun::star; using namespace ::com::sun::star::uno; @@ -631,7 +632,10 @@ bool Outliner::SearchAndReplaceAll() } else if (pViewShell->ISA(DrawViewShell)) { + // Disable selection change notifications during search all. pViewShell->GetDoc()->setTiledSearching(true); + comphelper::ScopeGuard aGuard([pViewShell]() { pViewShell->GetDoc()->setTiledSearching(false); }); + // Go to beginning/end of document. maObjectIterator = ::sd::outliner::OutlinerContainer(this).begin(); // Switch to the first object which contains the search string. @@ -681,7 +685,6 @@ bool Outliner::SearchAndReplaceAll() OString aPayload = aStream.str().c_str(); pViewShell->GetDoc()->libreOfficeKitCallback(LOK_CALLBACK_SEARCH_RESULT_SELECTION, aPayload.getStr()); } - pViewShell->GetDoc()->setTiledSearching(false); } RestoreStartPosition (); |