summaryrefslogtreecommitdiff
path: root/comphelper/source
diff options
context:
space:
mode:
authorAshod Nakashian <ashod.nakashian@collabora.co.uk>2019-04-13 21:40:20 -0400
committerJan Holesovsky <kendy@collabora.com>2019-06-12 11:52:39 +0200
commit953db3ca96d0055a83f718794416a9e39b0b20ce (patch)
treebcbf38d754e3614b709e799e0f884e283c4bdfa9 /comphelper/source
parent9e1d1e2cab4933e586910604d2044c085666de93 (diff)
comphelper: use dispatchwithNotification only when we have a callback
Change-Id: Ica7448458ecc5e9adc802a288f72b1fceb709f79 Reviewed-on: https://gerrit.libreoffice.org/70724 Reviewed-by: Ashod Nakashian <ashnakash@gmail.com> Tested-by: Ashod Nakashian <ashnakash@gmail.com> Reviewed-on: https://gerrit.libreoffice.org/73492 Tested-by: Jenkins Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Diffstat (limited to 'comphelper/source')
-rw-r--r--comphelper/source/misc/dispatchcommand.cxx16
1 files changed, 11 insertions, 5 deletions
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;
}