comphelper/source/misc/dispatchcommand.cxx |   16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

New commits:
commit 953db3ca96d0055a83f718794416a9e39b0b20ce
Author:     Ashod Nakashian <[email protected]>
AuthorDate: Sat Apr 13 21:40:20 2019 -0400
Commit:     Jan Holesovsky <[email protected]>
CommitDate: Wed Jun 12 11:52:39 2019 +0200

    comphelper: use dispatchwithNotification only when we have a callback
    
    Change-Id: Ica7448458ecc5e9adc802a288f72b1fceb709f79
    Reviewed-on: https://gerrit.libreoffice.org/70724
    Reviewed-by: Ashod Nakashian <[email protected]>
    Tested-by: Ashod Nakashian <[email protected]>
    Reviewed-on: https://gerrit.libreoffice.org/73492
    Tested-by: Jenkins
    Reviewed-by: Jan Holesovsky <[email protected]>

diff --git a/comphelper/source/misc/dispatchcommand.cxx 
b/comphelper/source/misc/dispatchcommand.cxx
index 0b5d3b18a65a..069a9d835032 100644
--- a/comphelper/source/misc/dispatchcommand.cxx
+++ b/comphelper/source/misc/dispatchcommand.cxx
@@ -48,11 +48,17 @@ bool dispatchCommand(const OUString& rCommand, const 
uno::Reference<css::frame::
         return false;
 
     // And do the work...
-    uno::Reference<frame::XNotifyingDispatch> xNotifyingDisp(xDisp, 
uno::UNO_QUERY);
-    if (xNotifyingDisp.is())
-        xNotifyingDisp->dispatchWithNotification(aCommandURL, rArguments, 
rListener);
-    else
-        xDisp->dispatch(aCommandURL, rArguments);
+    if (rListener.is())
+    {
+        uno::Reference<frame::XNotifyingDispatch> xNotifyingDisp(xDisp, 
uno::UNO_QUERY);
+        if (xNotifyingDisp.is())
+        {
+            xNotifyingDisp->dispatchWithNotification(aCommandURL, rArguments, 
rListener);
+            return true;
+        }
+    }
+
+    xDisp->dispatch(aCommandURL, rArguments);
 
     return true;
 }
_______________________________________________
Libreoffice-commits mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to