sd/source/ui/framework/factories/ViewShellWrapper.cxx | 13 ------------- sd/source/ui/framework/module/CenterViewFocusModule.cxx | 2 +- sd/source/ui/framework/tools/FrameworkHelper.cxx | 3 +-- sd/source/ui/inc/framework/ViewShellWrapper.hxx | 14 +++----------- 4 files changed, 5 insertions(+), 27 deletions(-)
New commits: commit 2dd86a1a062973ef3b1a3c312b98e9b9dcbaeeb1 Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Mon Jan 16 16:18:17 2023 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Tue Jan 17 06:43:34 2023 +0000 XUnoTunnel->dynamic_cast in ViewShellWrapper Change-Id: I204bbfc67a6c60723d8ebb21424ac5c184f9b2cc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145641 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/sd/source/ui/framework/factories/ViewShellWrapper.cxx b/sd/source/ui/framework/factories/ViewShellWrapper.cxx index 8f0fcd976537..294b7a550f60 100644 --- a/sd/source/ui/framework/factories/ViewShellWrapper.cxx +++ b/sd/source/ui/framework/factories/ViewShellWrapper.cxx @@ -206,19 +206,6 @@ sal_Bool SAL_CALL ViewShellWrapper::relocateToAnchor ( return bResult; } -//----- XUnoTunnel ------------------------------------------------------------ - -const Sequence<sal_Int8>& ViewShellWrapper::getUnoTunnelId() -{ - static const comphelper::UnoIdInit theViewShellWrapperUnoTunnelId; - return theViewShellWrapperUnoTunnelId.getSeq(); -} - -sal_Int64 SAL_CALL ViewShellWrapper::getSomething (const Sequence<sal_Int8>& rId) -{ - return comphelper::getSomethingImpl(rId, this); -} - //===== awt::XWindowListener ================================================== void SAL_CALL ViewShellWrapper::windowResized (const awt::WindowEvent&) diff --git a/sd/source/ui/framework/module/CenterViewFocusModule.cxx b/sd/source/ui/framework/module/CenterViewFocusModule.cxx index e36f95e33d9c..f5de61ca65d6 100644 --- a/sd/source/ui/framework/module/CenterViewFocusModule.cxx +++ b/sd/source/ui/framework/module/CenterViewFocusModule.cxx @@ -124,7 +124,7 @@ void CenterViewFocusModule::HandleNewView ( xView.set( mxConfigurationController->getResource(xViewIds[0]),UNO_QUERY); if (mpBase!=nullptr) { - auto pViewShellWrapper = comphelper::getFromUnoTunnel<ViewShellWrapper>(xView); + auto pViewShellWrapper = dynamic_cast<ViewShellWrapper*>(xView.get()); if (pViewShellWrapper != nullptr) { std::shared_ptr<ViewShell> pViewShell = pViewShellWrapper->GetViewShell(); diff --git a/sd/source/ui/framework/tools/FrameworkHelper.cxx b/sd/source/ui/framework/tools/FrameworkHelper.cxx index 2a10ead3f674..1b227d7ca6fd 100644 --- a/sd/source/ui/framework/tools/FrameworkHelper.cxx +++ b/sd/source/ui/framework/tools/FrameworkHelper.cxx @@ -199,8 +199,7 @@ namespace ::std::shared_ptr< ViewShell > pViewShell; try { - Reference<lang::XUnoTunnel> xViewTunnel( i_rViewShellWrapper, UNO_QUERY_THROW ); - if (auto pWrapper = comphelper::getFromUnoTunnel<ViewShellWrapper>(xViewTunnel)) + if (auto pWrapper = dynamic_cast<ViewShellWrapper*>(i_rViewShellWrapper.get())) pViewShell = pWrapper->GetViewShell(); } catch( const Exception& ) diff --git a/sd/source/ui/inc/framework/ViewShellWrapper.hxx b/sd/source/ui/inc/framework/ViewShellWrapper.hxx index 43dca4d6754a..fc944623a75a 100644 --- a/sd/source/ui/inc/framework/ViewShellWrapper.hxx +++ b/sd/source/ui/inc/framework/ViewShellWrapper.hxx @@ -23,7 +23,6 @@ #include <com/sun/star/drawing/framework/XRelocatableResource.hpp> #include <com/sun/star/view/XSelectionSupplier.hpp> #include <com/sun/star/awt/XWindowListener.hpp> -#include <com/sun/star/lang/XUnoTunnel.hpp> #include <comphelper/compbase.hxx> #include <memory> @@ -34,15 +33,14 @@ namespace com::sun::star::awt { class XWindow; } namespace sd::framework { -typedef comphelper::WeakComponentImplHelper < css::lang::XUnoTunnel - , css::awt::XWindowListener +typedef comphelper::WeakComponentImplHelper < css::awt::XWindowListener , css::view::XSelectionSupplier , css::drawing::framework::XRelocatableResource , css::drawing::framework::XView > ViewShellWrapperInterfaceBase; /** This class wraps ViewShell objects and makes them look like an XView. - Most importantly it provides a tunnel to the ViewShell implementation. + Most importantly it provides access to the ViewShell implementation. Then it forwards size changes of the pane window to the view shell. */ class ViewShellWrapper final : public ViewShellWrapperInterfaceBase @@ -68,18 +66,12 @@ public: virtual void disposing(std::unique_lock<std::mutex>&) override; virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override; - static const css::uno::Sequence<sal_Int8>& getUnoTunnelId(); - - /** This method is typically used together with the XUnoTunnel interface + /** This method is typically used to obtain a pointer to the wrapped ViewShell object for a given XView object. */ const ::std::shared_ptr<ViewShell>& GetViewShell() const { return mpViewShell;} - // XUnoTunnel - - virtual sal_Int64 SAL_CALL getSomething (const css::uno::Sequence<sal_Int8>& rId) override; - // XResource virtual css::uno::Reference<css::drawing::framework::XResourceId>