comphelper/source/misc/dispatchcommand.cxx | 20 +++++++++++--------- include/comphelper/dispatchcommand.hxx | 8 ++++---- 2 files changed, 15 insertions(+), 13 deletions(-)
New commits: commit 0e78f8aef1071ec6422ae9182b26cecba6113bb2 Author: Mike Kaganski <mike.kagan...@collabora.com> AuthorDate: Thu Jul 10 12:47:08 2025 +0500 Commit: Mike Kaganski <mike.kagan...@collabora.com> CommitDate: Thu Jul 10 11:18:25 2025 +0200 Simplify empty default value definition as {} It is cleaner IMO. Also use 'x' prefix instead of 'r' for UNO reference. Change-Id: If04b12c2381281311aef9a4bd9335459b2d80065 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/187608 Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com> Tested-by: Jenkins diff --git a/comphelper/source/misc/dispatchcommand.cxx b/comphelper/source/misc/dispatchcommand.cxx index 274e4234b6f6..d7ebd9e2668d 100644 --- a/comphelper/source/misc/dispatchcommand.cxx +++ b/comphelper/source/misc/dispatchcommand.cxx @@ -34,7 +34,7 @@ namespace comphelper { bool dispatchCommand(const OUString& rCommand, const uno::Reference<frame::XDispatchProvider>& xDispatchProvider, const uno::Sequence<beans::PropertyValue>& rArguments, - const uno::Reference<frame::XDispatchResultListener>& rListener) + const uno::Reference<frame::XDispatchResultListener>& xListener) { if (!xDispatchProvider.is()) return false; @@ -50,12 +50,12 @@ bool dispatchCommand(const OUString& rCommand, return false; // And do the work... - if (rListener.is()) + if (xListener.is()) { uno::Reference<frame::XNotifyingDispatch> xNotifyingDisp(xDisp, uno::UNO_QUERY); if (xNotifyingDisp.is()) { - xNotifyingDisp->dispatchWithNotification(aCommandURL, rArguments, rListener); + xNotifyingDisp->dispatchWithNotification(aCommandURL, rArguments, xListener); return true; } } @@ -68,20 +68,22 @@ bool dispatchCommand(const OUString& rCommand, bool dispatchCommand(const OUString& rCommand, const uno::Reference<frame::XFrame>& xFrame, const uno::Sequence<beans::PropertyValue>& rArguments, - const uno::Reference<frame::XDispatchResultListener>& rListener) + const uno::Reference<frame::XDispatchResultListener>& xListener) { - return dispatchCommand(rCommand, xFrame.query<frame::XDispatchProvider>(), rArguments, rListener); + return dispatchCommand(rCommand, xFrame.query<frame::XDispatchProvider>(), rArguments, xListener); } bool dispatchCommand(const OUString& rCommand, const uno::Reference<frame::XController>& xController, const uno::Sequence<beans::PropertyValue>& rArguments, - const uno::Reference<frame::XDispatchResultListener>& rListener) + const uno::Reference<frame::XDispatchResultListener>& xListener) { - return dispatchCommand(rCommand, xController.query<frame::XDispatchProvider>(), rArguments, rListener); + return dispatchCommand(rCommand, xController.query<frame::XDispatchProvider>(), rArguments, xListener); } -bool dispatchCommand(const OUString& rCommand, const css::uno::Sequence<css::beans::PropertyValue>& rArguments, const uno::Reference<css::frame::XDispatchResultListener>& rListener) +bool dispatchCommand(const OUString& rCommand, + const uno::Sequence<beans::PropertyValue>& rArguments, + const uno::Reference<frame::XDispatchResultListener>& xListener) { // Target where we will execute the .uno: command const uno::Reference<uno::XComponentContext>& xContext = ::comphelper::getProcessComponentContext(); @@ -91,7 +93,7 @@ bool dispatchCommand(const OUString& rCommand, const css::uno::Sequence<css::bea if (!xFrame.is()) xFrame = xDesktop; - return dispatchCommand(rCommand, xFrame, rArguments, rListener); + return dispatchCommand(rCommand, xFrame, rArguments, xListener); } } // namespace comphelper diff --git a/include/comphelper/dispatchcommand.hxx b/include/comphelper/dispatchcommand.hxx index 1630e8573ef0..85e5a4b28f33 100644 --- a/include/comphelper/dispatchcommand.hxx +++ b/include/comphelper/dispatchcommand.hxx @@ -35,22 +35,22 @@ namespace comphelper */ COMPHELPER_DLLPUBLIC bool dispatchCommand(const OUString& rCommand, const css::uno::Sequence<css::beans::PropertyValue>& rArguments, - const css::uno::Reference<css::frame::XDispatchResultListener>& rListener = css::uno::Reference<css::frame::XDispatchResultListener>()); + const css::uno::Reference<css::frame::XDispatchResultListener>& xListener = {}); COMPHELPER_DLLPUBLIC bool dispatchCommand(const OUString& rCommand, const css::uno::Reference<css::frame::XDispatchProvider>& xDispatchProvider, const css::uno::Sequence<css::beans::PropertyValue>& rArguments, - const css::uno::Reference<css::frame::XDispatchResultListener>& rListener = css::uno::Reference<css::frame::XDispatchResultListener>()); + const css::uno::Reference<css::frame::XDispatchResultListener>& xListener = {}); COMPHELPER_DLLPUBLIC bool dispatchCommand(const OUString& rCommand, const css::uno::Reference<css::frame::XFrame>& xFrame, const css::uno::Sequence<css::beans::PropertyValue>& rArguments, - const css::uno::Reference<css::frame::XDispatchResultListener>& rListener = css::uno::Reference<css::frame::XDispatchResultListener>()); + const css::uno::Reference<css::frame::XDispatchResultListener>& xListener = {}); COMPHELPER_DLLPUBLIC bool dispatchCommand(const OUString& rCommand, const css::uno::Reference<css::frame::XController>& xController, const css::uno::Sequence<css::beans::PropertyValue>& rArguments, - const css::uno::Reference<css::frame::XDispatchResultListener>& rListener = css::uno::Reference<css::frame::XDispatchResultListener>()); + const css::uno::Reference<css::frame::XDispatchResultListener>& xListener = {}); }