diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-01-12 16:30:20 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-01-13 18:32:21 +0000 |
commit | 9ca22b602154dfab8f45a98259e5365b0a5e7bc4 (patch) | |
tree | a757a42e12d1ef273ec059f6f10b08a449efa4f6 | |
parent | d60722e29a0dde6282915188e5ff7e24890a14d3 (diff) |
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.grandin@collabora.co.uk>
-rw-r--r-- | include/xmloff/attrlist.hxx | 7 | ||||
-rw-r--r-- | reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx | 6 | ||||
-rw-r--r-- | xmloff/source/core/attrlist.cxx | 9 |
3 files changed, 6 insertions, 16 deletions
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: */ |