editeng/source/items/xmlcnitm.cxx | 4 ++-- include/xmloff/attrlist.hxx | 7 +------ include/xmloff/unoatrcn.hxx | 9 ++------- reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx | 6 +++--- xmloff/source/core/attrlist.cxx | 9 ++------- xmloff/source/core/unoatrcn.cxx | 11 ----------- 6 files changed, 10 insertions(+), 36 deletions(-)
New commits: commit f2918ed9add416e16396965a4b6c7a5e8865a07f Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Thu Jan 12 16:33:01 2023 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Fri Jan 13 18:32:34 2023 +0000 XUnoTunnel->dynamic_cast in SvUnoAttributeContainer Change-Id: Ief76f12dd98e3455667b70d09605c82c0cedc4b9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145485 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/editeng/source/items/xmlcnitm.cxx b/editeng/source/items/xmlcnitm.cxx index 50733ade4dd4..7507ed2afdd0 100644 --- a/editeng/source/items/xmlcnitm.cxx +++ b/editeng/source/items/xmlcnitm.cxx @@ -76,8 +76,8 @@ bool SvXMLAttrContainerItem::QueryValue( css::uno::Any& rVal, sal_uInt8 /*nMembe bool SvXMLAttrContainerItem::PutValue( const css::uno::Any& rVal, sal_uInt8 /*nMemberId*/ ) { - Reference<XUnoTunnel> xTunnel(rVal, UNO_QUERY); - if (auto pContainer = comphelper::getFromUnoTunnel<SvUnoAttributeContainer>(xTunnel)) + Reference<XInterface> xTunnel(rVal, UNO_QUERY); + if (auto pContainer = dynamic_cast<SvUnoAttributeContainer*>(xTunnel.get())) { maContainerData = *pContainer->GetContainerImpl(); } diff --git a/include/xmloff/unoatrcn.hxx b/include/xmloff/unoatrcn.hxx index 8e5556bb18aa..b09a06250215 100644 --- a/include/xmloff/unoatrcn.hxx +++ b/include/xmloff/unoatrcn.hxx @@ -28,18 +28,16 @@ #include <sal/types.h> #include <com/sun/star/container/XNameContainer.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> -#include <com/sun/star/lang/XUnoTunnel.hpp> #include <xmloff/xmlcnimp.hxx> -#include <cppuhelper/implbase3.hxx> +#include <cppuhelper/implbase2.hxx> extern css::uno::Reference< css::uno::XInterface > SvUnoAttributeContainer_CreateInstance(); class XMLOFF_DLLPUBLIC SvUnoAttributeContainer final : - public ::cppu::WeakAggImplHelper3< + public ::cppu::WeakAggImplHelper2< css::lang::XServiceInfo, - css::lang::XUnoTunnel, css::container::XNameContainer > { private: @@ -52,9 +50,6 @@ public: SvUnoAttributeContainer( std::unique_ptr<SvXMLAttrContainerData> pContainer = nullptr ); SvXMLAttrContainerData* GetContainerImpl() const { return mpContainer.get(); } - static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId() noexcept; - virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override; - // css::container::XElementAccess virtual css::uno::Type SAL_CALL getElementType() override; virtual sal_Bool SAL_CALL hasElements() override; diff --git a/xmloff/source/core/unoatrcn.cxx b/xmloff/source/core/unoatrcn.cxx index 354cd47b49ce..676c1d75ac65 100644 --- a/xmloff/source/core/unoatrcn.cxx +++ b/xmloff/source/core/unoatrcn.cxx @@ -86,17 +86,6 @@ sal_uInt16 SvUnoAttributeContainer::getIndexByName(std::u16string_view aName ) c return USHRT_MAX; } -const css::uno::Sequence< sal_Int8 > & SvUnoAttributeContainer::getUnoTunnelId() noexcept -{ - static const comphelper::UnoIdInit theSvUnoAttributeContainerUnoTunnelId; - return theSvUnoAttributeContainerUnoTunnelId.getSeq(); -} - -sal_Int64 SAL_CALL SvUnoAttributeContainer::getSomething( const css::uno::Sequence< sal_Int8 >& rId ) -{ - return comphelper::getSomethingImpl(rId, this); -} - // container::XNameAccess uno::Any SAL_CALL SvUnoAttributeContainer::getByName(const OUString& aName) { commit 9ca22b602154dfab8f45a98259e5365b0a5e7bc4 Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Thu Jan 12 16:30:20 2023 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Fri Jan 13 18:32:21 2023 +0000 XUnoTunnel->dynamic_cast in SvXMLAttributeList Change-Id: I68806bf4b59f76c49f733283d9db21c68342c071 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145484 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/include/xmloff/attrlist.hxx b/include/xmloff/attrlist.hxx index 7f4fef2b9544..1261dd5c2ac9 100644 --- a/include/xmloff/attrlist.hxx +++ b/include/xmloff/attrlist.hxx @@ -24,7 +24,6 @@ #include <xmloff/dllapi.h> #include <com/sun/star/util/XCloneable.hpp> #include <com/sun/star/xml/sax/XAttributeList.hpp> -#include <com/sun/star/lang/XUnoTunnel.hpp> #include <comphelper/servicehelper.hxx> #include <cppuhelper/implbase.hxx> @@ -32,8 +31,7 @@ class XMLOFF_DLLPUBLIC SvXMLAttributeList final : public ::cppu::WeakImplHelper< css::xml::sax::XAttributeList, - css::util::XCloneable, - css::lang::XUnoTunnel> + css::util::XCloneable> { struct SvXMLTagAttribute_Impl { @@ -48,9 +46,6 @@ public: css::xml::sax::XAttributeList> & rAttrList ); virtual ~SvXMLAttributeList() override; - // XUnoTunnel - UNO3_GETIMPLEMENTATION_DECL(SvXMLAttributeList) - // css::xml::sax::XAttributeList virtual sal_Int16 SAL_CALL getLength() override; virtual OUString SAL_CALL getNameByIndex(sal_Int16 i) override; diff --git a/reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx b/reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx index 9c80fdefb34d..95cc0ffca589 100644 --- a/reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx +++ b/reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx @@ -58,7 +58,7 @@ OUString lcl_createAttribute(const xmloff::token::XMLTokenEnum& _eNamespace,cons static void lcl_correctCellAddress(const OUString & _sName, const uno::Reference< xml::sax::XAttributeList > & xAttribs) { - SvXMLAttributeList* pList = comphelper::getFromUnoTunnel<SvXMLAttributeList>(xAttribs); + SvXMLAttributeList* pList = dynamic_cast<SvXMLAttributeList*>(xAttribs.get()); OUString sCellAddress = pList->getValueByName(_sName); const sal_Int32 nPos = sCellAddress.lastIndexOf('$'); if ( nPos != -1 ) @@ -186,7 +186,7 @@ void SAL_CALL ExportDocumentHandler::startElement(const OUString & _sName, const bExport = false; else if ( _sName == "chart:plot-area" ) { - SvXMLAttributeList* pList = comphelper::getFromUnoTunnel<SvXMLAttributeList>(xAttribs); + SvXMLAttributeList* pList = dynamic_cast<SvXMLAttributeList*>(xAttribs.get()); pList->RemoveAttribute("table:cell-range-address"); } else if ( _sName == "chart:categories" ) @@ -201,7 +201,7 @@ void SAL_CALL ExportDocumentHandler::startElement(const OUString & _sName, const } else if ( m_bTableRowsStarted && !m_bFirstRowExported && _sName == "table:table-cell" ) { - SvXMLAttributeList* pList = comphelper::getFromUnoTunnel<SvXMLAttributeList>(xAttribs); + SvXMLAttributeList* pList = dynamic_cast<SvXMLAttributeList*>(xAttribs.get()); static OUString s_sValue(lcl_createAttribute(XML_NP_OFFICE,XML_VALUE)); pList->RemoveAttribute(s_sValue); } diff --git a/xmloff/source/core/attrlist.cxx b/xmloff/source/core/attrlist.cxx index 3f9fbb6a8634..5d02d074bc9e 100644 --- a/xmloff/source/core/attrlist.cxx +++ b/xmloff/source/core/attrlist.cxx @@ -38,15 +38,14 @@ sal_Int16 SAL_CALL SvXMLAttributeList::getLength() SvXMLAttributeList::SvXMLAttributeList( const SvXMLAttributeList &r ) : - cppu::WeakImplHelper<css::xml::sax::XAttributeList, css::util::XCloneable, css::lang::XUnoTunnel>(r), + cppu::WeakImplHelper<css::xml::sax::XAttributeList, css::util::XCloneable>(r), vecAttribute( r.vecAttribute ) { } SvXMLAttributeList::SvXMLAttributeList( const uno::Reference< xml::sax::XAttributeList> & rAttrList ) { - SvXMLAttributeList* pImpl = - comphelper::getFromUnoTunnel<SvXMLAttributeList>( rAttrList ); + SvXMLAttributeList* pImpl = dynamic_cast<SvXMLAttributeList*>( rAttrList.get() ); if( pImpl ) vecAttribute = pImpl->vecAttribute; @@ -185,8 +184,4 @@ sal_Int16 SvXMLAttributeList::GetIndexByName( const OUString& rName ) const return -1; } -// XUnoTunnel & co -UNO3_GETIMPLEMENTATION_IMPL(SvXMLAttributeList) - - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */