diff options
-rw-r--r-- | sfx2/source/devtools/DevelopmentToolDockingWindow.cxx | 3 | ||||
-rw-r--r-- | sfx2/source/devtools/SelectionChangeHandler.hxx | 16 |
2 files changed, 17 insertions, 2 deletions
diff --git a/sfx2/source/devtools/DevelopmentToolDockingWindow.cxx b/sfx2/source/devtools/DevelopmentToolDockingWindow.cxx index de0950a7edaf..736343310bd5 100644 --- a/sfx2/source/devtools/DevelopmentToolDockingWindow.cxx +++ b/sfx2/source/devtools/DevelopmentToolDockingWindow.cxx @@ -14,6 +14,7 @@ #include <com/sun/star/view/XSelectionSupplier.hpp> +#include <comphelper/servicehelper.hxx> #include <sfx2/dispatch.hxx> #include <sfx2/objsh.hxx> #include <sfx2/viewfrm.hxx> @@ -87,7 +88,7 @@ void DevelopmentToolDockingWindow::dispose() { // Stop and remove the listener auto* pSelectionChangeHandler - = dynamic_cast<SelectionChangeHandler*>(mxSelectionListener.get()); + = comphelper::getFromUnoTunnel<SelectionChangeHandler>(mxSelectionListener); if (pSelectionChangeHandler) pSelectionChangeHandler->stopListening(); 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; |