[Libreoffice-commits] core.git: sd/source

Miklos Vajna vmiklos at collabora.co.uk
Thu Jan 14 10:37:04 PST 2016


 sd/source/ui/view/Outliner.cxx |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit 6372080cd396a7e8608806a35a1be68d288b8fda
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Thu Jan 14 17:26:00 2016 +0100

    sd: use ScopeGuard in Outliner::SearchAndReplaceAll()
    
    So the flag will be reset on early return as well.
    
    Change-Id: Ib086ec4a02dda291a0291a8ac40660c16de0fbf6

diff --git a/sd/source/ui/view/Outliner.cxx b/sd/source/ui/view/Outliner.cxx
index afe5b87..ce7aef6 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 ();


More information about the Libreoffice-commits mailing list