sc/inc/textuno.hxx | 7 ------- sc/source/ui/unoobj/textuno.cxx | 16 +--------------- sd/source/ui/framework/factories/Pane.cxx | 13 ------------- sd/source/ui/inc/framework/Pane.hxx | 16 ++++------------ sd/source/ui/view/ViewTabBar.cxx | 3 +-- 5 files changed, 6 insertions(+), 49 deletions(-)
New commits: commit fe48df2684aa2877b26a112b738f3756db10fa6d Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Mon Jan 16 16:14:47 2023 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Tue Jan 17 06:43:26 2023 +0000 XUnoTunnel->dynamic_cast in sd::framework::Pane Change-Id: I3e6408af0b57bd3b714551c42a31b5b0aabaf3a0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145640 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/sd/source/ui/framework/factories/Pane.cxx b/sd/source/ui/framework/factories/Pane.cxx index a188f0e11799..c128a5351f14 100644 --- a/sd/source/ui/framework/factories/Pane.cxx +++ b/sd/source/ui/framework/factories/Pane.cxx @@ -136,19 +136,6 @@ sal_Bool SAL_CALL Pane::isAnchorOnly() return true; } -//----- XUnoTunnel ------------------------------------------------------------ - -const Sequence<sal_Int8>& Pane::getUnoTunnelId() -{ - static const comphelper::UnoIdInit thePaneUnoTunnelId; - return thePaneUnoTunnelId.getSeq(); -} - -sal_Int64 SAL_CALL Pane::getSomething (const Sequence<sal_Int8>& rId) -{ - return comphelper::getSomethingImpl(rId, this); -} - Reference<rendering::XCanvas> Pane::CreateCanvas() { Reference<rendering::XCanvas> xCanvas; diff --git a/sd/source/ui/inc/framework/Pane.hxx b/sd/source/ui/inc/framework/Pane.hxx index 9e8ee25a1f73..51b7a5ed0934 100644 --- a/sd/source/ui/inc/framework/Pane.hxx +++ b/sd/source/ui/inc/framework/Pane.hxx @@ -21,7 +21,6 @@ #include <com/sun/star/drawing/framework/XPane.hpp> #include <com/sun/star/drawing/framework/XPane2.hpp> -#include <com/sun/star/lang/XUnoTunnel.hpp> #include <cppuhelper/basemutex.hxx> #include <cppuhelper/compbase.hxx> #include <vcl/vclptr.hxx> @@ -31,8 +30,7 @@ namespace sd::framework { typedef ::cppu::WeakComponentImplHelper < css::drawing::framework::XPane, - css::drawing::framework::XPane2, - css::lang::XUnoTunnel + css::drawing::framework::XPane2 > PaneInterfaceBase; /** A pane is a wrapper for a window and possibly for a tab bar (for view @@ -42,8 +40,8 @@ typedef ::cppu::WeakComponentImplHelper < 1. It implements the XPane interface. This is the most important interface of this class for API based views (of which there not that many yet) because it gives access to the XWindow. - 2. It gives access to the underlying VCL Window by implementing the - XUnoTunnel interface. This is necessary at the moment and in the + 2. It gives access to the underlying VCL Window. + This is necessary at the moment and in the foreseeable future because many parts of the Draw and Impress views rely on direct access on the Window class. */ @@ -69,9 +67,7 @@ public: virtual void SAL_CALL disposing() override; - static const css::uno::Sequence<sal_Int8>& getUnoTunnelId(); - - /** This method is typically used together with the XUnoTunnel to obtain + /** This method is typically used to obtain a Window pointer from an XPane object. */ virtual vcl::Window* GetWindow(); @@ -109,10 +105,6 @@ public: */ virtual sal_Bool SAL_CALL isAnchorOnly() override; - //----- XUnoTunnel -------------------------------------------------------- - - virtual sal_Int64 SAL_CALL getSomething (const css::uno::Sequence<sal_Int8>& rId) override; - protected: css::uno::Reference<css::drawing::framework::XResourceId> mxPaneId; VclPtr<vcl::Window> mpWindow; diff --git a/sd/source/ui/view/ViewTabBar.cxx b/sd/source/ui/view/ViewTabBar.cxx index 588b55eaee8b..d9fdd2addfdf 100644 --- a/sd/source/ui/view/ViewTabBar.cxx +++ b/sd/source/ui/view/ViewTabBar.cxx @@ -185,8 +185,7 @@ vcl::Window* ViewTabBar::GetAnchorWindow( // Tunnel through the XWindow to the VCL side. try { - Reference<lang::XUnoTunnel> xTunnel (xPane, UNO_QUERY_THROW); - if (auto pPane = comphelper::getFromUnoTunnel<framework::Pane>(xTunnel)) + if (auto pPane = dynamic_cast<framework::Pane*>(xPane.get())) pWindow = pPane->GetWindow()->GetParent(); } catch (const RuntimeException&) commit bd881e48f7860596096a45816c559ac100b0bf59 Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Mon Jan 16 14:07:19 2023 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Tue Jan 17 06:43:18 2023 +0000 XUnoTunnel->dynamic_cast in ScHeaderFooterContentObj Change-Id: I3edc648a4a0afbfd2922befc9e1962df0a22b54f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145637 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/sc/inc/textuno.hxx b/sc/inc/textuno.hxx index 55136ef2348c..e5ec1aca0cad 100644 --- a/sc/inc/textuno.hxx +++ b/sc/inc/textuno.hxx @@ -25,7 +25,6 @@ #include <com/sun/star/text/XTextFieldsSupplier.hpp> #include <com/sun/star/sheet/XHeaderFooterContent.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> -#include <com/sun/star/lang/XUnoTunnel.hpp> #include <comphelper/servicehelper.hxx> #include <cppuhelper/implbase.hxx> #include <cppuhelper/weakref.hxx> @@ -54,7 +53,6 @@ enum class ScHeaderFooterPart{ LEFT, CENTER, RIGHT }; class ScHeaderFooterContentObj final : public cppu::WeakImplHelper< css::sheet::XHeaderFooterContent, - css::lang::XUnoTunnel, css::lang::XServiceInfo > { private: @@ -83,11 +81,6 @@ public: virtual css::uno::Reference< css::text::XText > SAL_CALL getRightText() override; - // XUnoTunnel - virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< - sal_Int8 >& aIdentifier ) override; - - static const css::uno::Sequence<sal_Int8>& getUnoTunnelId(); static rtl::Reference<ScHeaderFooterContentObj> getImplementation(const css::uno::Reference<css::sheet::XHeaderFooterContent>& rObj); // XServiceInfo diff --git a/sc/source/ui/unoobj/textuno.cxx b/sc/source/ui/unoobj/textuno.cxx index ec66ebe1877e..b8056d0c90d1 100644 --- a/sc/source/ui/unoobj/textuno.cxx +++ b/sc/source/ui/unoobj/textuno.cxx @@ -127,24 +127,10 @@ uno::Reference<text::XText> SAL_CALL ScHeaderFooterContentObj::getRightText() return xInt; } -// XUnoTunnel - -sal_Int64 SAL_CALL ScHeaderFooterContentObj::getSomething( - const uno::Sequence<sal_Int8 >& rId ) -{ - return comphelper::getSomethingImpl(rId, this); -} - -const uno::Sequence<sal_Int8>& ScHeaderFooterContentObj::getUnoTunnelId() -{ - static const comphelper::UnoIdInit theScHeaderFooterContentObjUnoTunnelId; - return theScHeaderFooterContentObjUnoTunnelId.getSeq(); -} - rtl::Reference<ScHeaderFooterContentObj> ScHeaderFooterContentObj::getImplementation( const uno::Reference<sheet::XHeaderFooterContent>& rObj) { - return comphelper::getFromUnoTunnel<ScHeaderFooterContentObj>(rObj); + return dynamic_cast<ScHeaderFooterContentObj*>(rObj.get()); } void ScHeaderFooterContentObj::Init( const EditTextObject* pLeft,