diff options
Diffstat (limited to 'comphelper')
-rw-r--r-- | comphelper/source/misc/dispatchcommand.cxx | 16 |
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; } |