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:36:37 +0100 |
commit | 6372080cd396a7e8608806a35a1be68d288b8fda (patch) | |
tree | 284c2dd7b2a766f0ca7c52ff9186e31c7256786e /sd/source | |
parent | abbf57dd41c29fa6a16328247776c1d3cc7024fa (diff) |
sd: use ScopeGuard in Outliner::SearchAndReplaceAll()
So the flag will be reset on early return as well.
Change-Id: Ib086ec4a02dda291a0291a8ac40660c16de0fbf6
Diffstat (limited to 'sd/source')
-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 afe5b87fc18c..ce7aef6aad15 100644 --- a/sd/source/ui/view/Outliner.cxx +++ b/sd/source/ui/view/Outliner.cxx @@ -75,6 +75,7 @@ #include <LibreOfficeKit/LibreOfficeKitEnums.h> #include <comphelper/string.hxx> #include <comphelper/lok.hxx> +#include <comphelper/scopeguard.hxx> using namespace ::com::sun::star; using namespace ::com::sun::star::uno; @@ -617,7 +618,10 @@ bool Outliner::SearchAndReplaceAll() } else if( nullptr != dynamic_cast< const DrawViewShell *>( pViewShell.get() )) { + // 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. @@ -667,7 +671,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 (); |