diff options
-rw-r--r-- | include/xmloff/xmlimp.hxx | 2 | ||||
-rw-r--r-- | reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx | 3 | ||||
-rw-r--r-- | sdext/source/pdfimport/sax/emitcontext.cxx | 3 | ||||
-rw-r--r-- | writerperfect/source/common/DocumentHandler.cxx | 3 |
4 files changed, 7 insertions, 4 deletions
diff --git a/include/xmloff/xmlimp.hxx b/include/xmloff/xmlimp.hxx index 26873175268d..14c7b92556b1 100644 --- a/include/xmloff/xmlimp.hxx +++ b/include/xmloff/xmlimp.hxx @@ -176,7 +176,7 @@ public: virtual void SAL_CALL setDocumentLocator(const css::uno::Reference< css::xml::sax::XLocator > & xLocator) override; }; -class XMLOFF_DLLPUBLIC SAL_LOPLUGIN_ANNOTATE("crosscast") SvXMLImport : public cppu::WeakImplHelper< +class XMLOFF_DLLPUBLIC SvXMLImport : public cppu::WeakImplHelper< css::xml::sax::XFastDocumentHandler, css::lang::XServiceInfo, css::lang::XInitialization, diff --git a/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx b/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx index eb3da46309f8..3f919548d47d 100644 --- a/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx +++ b/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx @@ -28,6 +28,7 @@ #include <com/sun/star/reflection/ProxyFactory.hpp> #include <comphelper/sequenceashashmap.hxx> #include <comphelper/namedvaluecollection.hxx> +#include <comphelper/servicehelper.hxx> #include <cppuhelper/supportsservice.hxx> #include <utility> #include <xmloff/attrlist.hxx> @@ -339,7 +340,7 @@ void SAL_CALL ImportDocumentHandler::initialize( const uno::Sequence< uno::Any > if (!m_xDocumentHandler.is() || !m_xModel.is()) throw uno::Exception("no delegatee and no model", nullptr); - m_xDelegatee.set(new SvXMLLegacyToFastDocHandler(dynamic_cast<SvXMLImport*>(m_xDocumentHandler.get()))); + m_xDelegatee.set(new SvXMLLegacyToFastDocHandler(comphelper::getFromUnoTunnel<SvXMLImport>(m_xDocumentHandler))); m_xDatabaseDataProvider.set(m_xModel->getDataProvider(),uno::UNO_QUERY); if ( !m_xDatabaseDataProvider.is() ) diff --git a/sdext/source/pdfimport/sax/emitcontext.cxx b/sdext/source/pdfimport/sax/emitcontext.cxx index a923488d688d..59f110191bfd 100644 --- a/sdext/source/pdfimport/sax/emitcontext.cxx +++ b/sdext/source/pdfimport/sax/emitcontext.cxx @@ -25,6 +25,7 @@ #include <rtl/strbuf.hxx> #include <osl/diagnose.h> #include <com/sun/star/xml/sax/SAXException.hpp> +#include <comphelper/servicehelper.hxx> #include <xmloff/xmlimp.hxx> #if OSL_DEBUG_LEVEL > 0 @@ -42,7 +43,7 @@ SaxEmitter::SaxEmitter( const uno::Reference< xml::sax::XDocumentHandler >& xDoc m_xDocHdl( xDocHdl ) { OSL_PRECOND(m_xDocHdl.is(), "SaxEmitter(): invalid doc handler"); - if (SvXMLImport *pFastHandler = dynamic_cast<SvXMLImport*>(m_xDocHdl.get())) + if (SvXMLImport *pFastHandler = comphelper::getFromUnoTunnel<SvXMLImport>(m_xDocHdl)) m_xDocHdl.set( new SvXMLLegacyToFastDocHandler( pFastHandler ) ); try { diff --git a/writerperfect/source/common/DocumentHandler.cxx b/writerperfect/source/common/DocumentHandler.cxx index 6b5ffe58ad9e..6cf42c168a51 100644 --- a/writerperfect/source/common/DocumentHandler.cxx +++ b/writerperfect/source/common/DocumentHandler.cxx @@ -15,6 +15,7 @@ #include <com/sun/star/xml/sax/XDocumentHandler.hpp> #include <com/sun/star/xml/sax/XAttributeList.hpp> +#include <comphelper/servicehelper.hxx> #include <xmloff/attrlist.hxx> #include <xmloff/xmlimp.hxx> @@ -115,7 +116,7 @@ using com::sun::star::xml::sax::XDocumentHandler; DocumentHandler::DocumentHandler(Reference<XDocumentHandler> const& xHandler) : mxHandler(xHandler) { - if (SvXMLImport* pFastHandler = dynamic_cast<SvXMLImport*>(mxHandler.get())) + if (SvXMLImport* pFastHandler = comphelper::getFromUnoTunnel<SvXMLImport>(mxHandler)) mxHandler.set(new SvXMLLegacyToFastDocHandler(pFastHandler)); } |