diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2022-12-13 11:28:31 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2022-12-14 08:55:19 +0000 |
commit | a98acca8fbc38d3fd5600ae5056a8e42b6d8a40d (patch) | |
tree | e5472e33a1eeb79b4bb2c844b62186feedda79b2 /sfx2/source/devtools/SelectionChangeHandler.hxx | |
parent | 276e3ccbdd3259ec3daf8a1a98fa7f406b14e21c (diff) |
loplugin:unocast (SelectionChangeHandler)
(See the upcoming commit introducing that loplugin:unocast on why such
dynamic_casts from UNO types are dangerous.)
Change-Id: Ibc2511c8521923c854e4b450649ea616581af2fa
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144141
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'sfx2/source/devtools/SelectionChangeHandler.hxx')
-rw-r--r-- | sfx2/source/devtools/SelectionChangeHandler.hxx | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/sfx2/source/devtools/SelectionChangeHandler.hxx b/sfx2/source/devtools/SelectionChangeHandler.hxx index 57224e056a52..f919a2fe1400 100644 --- a/sfx2/source/devtools/SelectionChangeHandler.hxx +++ b/sfx2/source/devtools/SelectionChangeHandler.hxx @@ -13,12 +13,15 @@ #include <sfx2/devtools/DevelopmentToolDockingWindow.hxx> #include <com/sun/star/frame/XController.hpp> +#include <com/sun/star/lang/XUnoTunnel.hpp> #include <com/sun/star/view/XSelectionSupplier.hpp> #include <comphelper/compbase.hxx> +#include <comphelper/servicehelper.hxx> #include <utility> -typedef comphelper::WeakComponentImplHelper<css::view::XSelectionChangeListener> +typedef comphelper::WeakComponentImplHelper<css::view::XSelectionChangeListener, + css::lang::XUnoTunnel> SelectionChangeHandlerInterfaceBase; /** Selection change handler to listen to document selection changes. @@ -67,6 +70,17 @@ public: virtual void SAL_CALL disposing(const css::lang::EventObject& /*rEvent*/) override {} using comphelper::WeakComponentImplHelperBase::disposing; + sal_Int64 SAL_CALL getSomething(css::uno::Sequence<sal_Int8> const& aIdentifier) override + { + return comphelper::getSomethingImpl(aIdentifier, this); + } + + static css::uno::Sequence<sal_Int8> const& getUnoTunnelId() + { + static comphelper::UnoIdInit const id; + return id.getSeq(); + } + private: SelectionChangeHandler(const SelectionChangeHandler&) = delete; SelectionChangeHandler& operator=(const SelectionChangeHandler&) = delete; |