From e5e40c0bf56806540850d440ad10a26f33e3387c Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Fri, 13 Jan 2023 09:29:04 +0200 Subject: [PATCH] XUnoTunnel->dynamic_cast in StyleMap Change-Id: Ib4070fbff0c919cdc2be12f5a2bed1b1ac9e03c3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145505 Tested-by: Jenkins Reviewed-by: Noel Grandin --- xmloff/inc/StyleMap.hxx | 6 +----- xmloff/source/core/xmlimp.cxx | 4 ++-- xmloff/source/style/StyleMap.cxx | 3 --- 3 files changed, 3 insertions(+), 10 deletions(-) diff --git a/xmloff/inc/StyleMap.hxx b/xmloff/inc/StyleMap.hxx index 5cea47b24159..796245f52fc7 100644 --- a/xmloff/inc/StyleMap.hxx +++ b/xmloff/inc/StyleMap.hxx @@ -19,7 +19,6 @@ #pragma once -#include #include #include #include @@ -64,7 +63,7 @@ inline bool StyleNameHash_Impl::operator()( } class StyleMap final : - public ::cppu::WeakImplHelper< css::lang::XUnoTunnel>, + public ::cppu::WeakImplHelper<>, public std::unordered_map< StyleNameKey_Impl, OUString, StyleNameHash_Impl, StyleNameHash_Impl > { @@ -73,9 +72,6 @@ public: StyleMap(); virtual ~StyleMap() override; - - // XUnoTunnel - UNO3_GETIMPLEMENTATION_DECL(StyleMap) }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx index 4f33a1ab6607..6d166def862b 100644 --- a/xmloff/source/core/xmlimp.cxx +++ b/xmloff/source/core/xmlimp.cxx @@ -982,7 +982,7 @@ void SAL_CALL SvXMLImport::initialize( const uno::Sequence< uno::Any >& aArgumen uno::Any aAny = mxImportInfo->getPropertyValue(sPropName); aAny >>= xIfc; - StyleMap *pSMap = comphelper::getFromUnoTunnel( xIfc ); + StyleMap *pSMap = dynamic_cast( xIfc.get() ); if( pSMap ) { mpStyleMap = pSMap; @@ -1393,7 +1393,7 @@ void SvXMLImport::AddStyleDisplayName( XmlStyleFamily nFamily, xPropertySetInfo->hasPropertyByName(sPrivateData) ) { Reference < XInterface > xIfc( - static_cast< css::lang::XUnoTunnel *>( mpStyleMap.get() ) ); + static_cast< css::lang::XTypeProvider *>( mpStyleMap.get() ) ); mxImportInfo->setPropertyValue( sPrivateData, Any(xIfc) ); } } diff --git a/xmloff/source/style/StyleMap.cxx b/xmloff/source/style/StyleMap.cxx index 1d52ea112374..cb7acfb33d53 100644 --- a/xmloff/source/style/StyleMap.cxx +++ b/xmloff/source/style/StyleMap.cxx @@ -26,7 +26,4 @@ StyleMap::StyleMap() {} StyleMap::~StyleMap() {} -// XUnoTunnel & co -UNO3_GETIMPLEMENTATION_IMPL(StyleMap); - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */