include/xmloff/xmlexp.hxx | 7 +------ sc/source/filter/xml/xmlexprt.cxx | 7 ------- sc/source/filter/xml/xmlexprt.hxx | 3 --- sc/source/filter/xml/xmlwrap.cxx | 2 +- starmath/inc/mathml/export.hxx | 4 ---- starmath/inc/mathml/mathmlexport.hxx | 4 ---- starmath/source/mathml/export.cxx | 16 ++-------------- starmath/source/mathml/mathmlexport.cxx | 14 +------------- sw/source/filter/xml/xmlexp.cxx | 12 ------------ sw/source/filter/xml/xmlexp.hxx | 4 ---- xmloff/source/core/xmlexp.cxx | 3 --- 11 files changed, 5 insertions(+), 71 deletions(-)
New commits: commit d66d1f6fd47b02076945c09c0d6f8f019d0501d5 Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Thu Jan 12 16:39:44 2023 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Sat Jan 14 07:28:18 2023 +0000 XUnoTunnel->dynamic_cast in SvXMLExport Change-Id: I68e4691ac0a58e2320b534d15934ff177feb124d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145493 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/include/xmloff/xmlexp.hxx b/include/xmloff/xmlexp.hxx index 37a9096a0b32..818f524ad545 100644 --- a/include/xmloff/xmlexp.hxx +++ b/include/xmloff/xmlexp.hxx @@ -24,7 +24,6 @@ #include <xmloff/dllapi.h> #include <sal/types.h> -#include <com/sun/star/lang/XUnoTunnel.hpp> #include <rtl/ustring.hxx> #include <xmloff/attrlist.hxx> #include <xmloff/txtparae.hxx> @@ -113,8 +112,7 @@ class XMLOFF_DLLPUBLIC SvXMLExport : public cppu::WeakImplHelper< css::lang::XServiceInfo, css::document::XExporter, css::lang::XInitialization, - css::container::XNamed, - css::lang::XUnoTunnel> + css::container::XNamed> { std::unique_ptr<SvXMLExport_Impl> mpImpl; // dummy @@ -311,9 +309,6 @@ public: virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) final override; virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) final override; - // XUnoTunnel - UNO3_GETIMPLEMENTATION_DECL(SvXMLExport) - /** ensures that the given namespace is in scope at the next started element. diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx index 051c0ac251b3..e164766fa677 100644 --- a/sc/source/filter/xml/xmlexprt.cxx +++ b/sc/source/filter/xml/xmlexprt.cxx @@ -5449,13 +5449,6 @@ void SAL_CALL ScXMLExport::initialize( const css::uno::Sequence< css::uno::Any > SvXMLExport::initialize(aArguments); } -// XUnoTunnel -sal_Int64 SAL_CALL ScXMLExport::getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) -{ - SolarMutexGuard aGuard; - return SvXMLExport::getSomething(aIdentifier); -} - void ScXMLExport::DisposingModel() { SvXMLExport::DisposingModel(); diff --git a/sc/source/filter/xml/xmlexprt.hxx b/sc/source/filter/xml/xmlexprt.hxx index 8ab8901d4671..a29ab0ea45d8 100644 --- a/sc/source/filter/xml/xmlexprt.hxx +++ b/sc/source/filter/xml/xmlexprt.hxx @@ -271,9 +271,6 @@ public: // XInitialization virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) override; - // XUnoTunnel - virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override; - virtual void DisposingModel() override; }; diff --git a/sc/source/filter/xml/xmlwrap.cxx b/sc/source/filter/xml/xmlwrap.cxx index 79cb3a9fc06a..1bcd82311d26 100644 --- a/sc/source/filter/xml/xmlwrap.cxx +++ b/sc/source/filter/xml/xmlwrap.cxx @@ -660,7 +660,7 @@ bool ScXMLImportWrapper::ExportToComponent(const uno::Reference<uno::XComponentC if ( xFilter.is() ) { - ScXMLExport* pExport = static_cast<ScXMLExport*>(comphelper::getFromUnoTunnel<SvXMLExport>(xFilter)); + ScXMLExport* pExport = static_cast<ScXMLExport*>(dynamic_cast<SvXMLExport*>(xFilter.get())); pExport->SetSharedData(std::move(pSharedData)); // if there are sheets to copy, get the source stream diff --git a/starmath/inc/mathml/export.hxx b/starmath/inc/mathml/export.hxx index 12e541d31551..0ed354be4b67 100644 --- a/starmath/inc/mathml/export.hxx +++ b/starmath/inc/mathml/export.hxx @@ -204,10 +204,6 @@ private: SmDocShell* getSmDocShell(); public: - // XUnoTunnel - sal_Int64 SAL_CALL getSomething(const css::uno::Sequence<sal_Int8>& rId) override; - static const css::uno::Sequence<sal_Int8>& getUnoTunnelId() noexcept; - /** Exports auto styles * However math doesn't have any */ diff --git a/starmath/inc/mathml/mathmlexport.hxx b/starmath/inc/mathml/mathmlexport.hxx index 28e35a7c52a0..74a655174089 100644 --- a/starmath/inc/mathml/mathmlexport.hxx +++ b/starmath/inc/mathml/mathmlexport.hxx @@ -109,10 +109,6 @@ public: SmXMLExport(const css::uno::Reference<css::uno::XComponentContext>& rContext, OUString const& implementationName, SvXMLExportFlags nExportFlags); - // XUnoTunnel - sal_Int64 SAL_CALL getSomething(const css::uno::Sequence<sal_Int8>& rId) override; - static const css::uno::Sequence<sal_Int8>& getUnoTunnelId() noexcept; - void ExportAutoStyles_() override {} void ExportMasterStyles_() override {} void ExportContent_() override; diff --git a/starmath/source/mathml/export.cxx b/starmath/source/mathml/export.cxx index b55be509216b..c9b7bbf6d41a 100644 --- a/starmath/source/mathml/export.cxx +++ b/starmath/source/mathml/export.cxx @@ -331,7 +331,7 @@ bool SmMLExportWrapper::WriteThroughComponentOS(const Reference<io::XOutputStrea // filter if (nSyntaxVersion == 5) { - SmXMLExport* pFilter = comphelper::getFromUnoTunnel<SmXMLExport>(xFilter); + SmXMLExport* pFilter = dynamic_cast<SmXMLExport*>(xFilter.get()); if (pFilter == nullptr) { SAL_WARN("starmath", "Failed to fetch SmMLExport"); @@ -342,7 +342,7 @@ bool SmMLExportWrapper::WriteThroughComponentOS(const Reference<io::XOutputStrea } // filter - SmMLExport* pFilter = comphelper::getFromUnoTunnel<SmMLExport>(xFilter); + SmMLExport* pFilter = dynamic_cast<SmMLExport*>(xFilter.get()); // Setup filter if (pFilter == nullptr) @@ -439,18 +439,6 @@ SmMLExportWrapper::WriteThroughComponentMS(const Reference<XComponent>& xCompone // SmMLExport technical /*************************************************************************************************/ -sal_Int64 SAL_CALL SmMLExport::getSomething(const uno::Sequence<sal_Int8>& rId) -{ - return comphelper::getSomethingImpl(rId, this, - comphelper::FallbackToGetSomethingOf<SvXMLExport>{}); -} - -const uno::Sequence<sal_Int8>& SmMLExport::getUnoTunnelId() noexcept -{ - static const comphelper::UnoIdInit theSmMLExportUnoTunnelId; - return theSmMLExportUnoTunnelId.getSeq(); -} - extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface* Math_MLExporter_get_implementation(css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any> const&) diff --git a/starmath/source/mathml/mathmlexport.cxx b/starmath/source/mathml/mathmlexport.cxx index bbb5bfc18a4d..9a2c6cd2db8f 100644 --- a/starmath/source/mathml/mathmlexport.cxx +++ b/starmath/source/mathml/mathmlexport.cxx @@ -263,7 +263,7 @@ bool SmXMLExportWrapper::WriteThroughComponent(const Reference<io::XOutputStream uno::Sequence<PropertyValue> aProps(0); xFilter->filter(aProps); - auto pFilter = comphelper::getFromUnoTunnel<SmXMLExport>(xFilter); + auto pFilter = dynamic_cast<SmXMLExport*>(xFilter.get()); return pFilter == nullptr || pFilter->GetSuccess(); } @@ -323,18 +323,6 @@ SmXMLExport::SmXMLExport(const css::uno::Reference<css::uno::XComponentContext>& { } -sal_Int64 SAL_CALL SmXMLExport::getSomething(const uno::Sequence<sal_Int8>& rId) -{ - return comphelper::getSomethingImpl(rId, this, - comphelper::FallbackToGetSomethingOf<SvXMLExport>{}); -} - -const uno::Sequence<sal_Int8>& SmXMLExport::getUnoTunnelId() noexcept -{ - static const comphelper::UnoIdInit theSmXMLExportUnoTunnelId; - return theSmXMLExportUnoTunnelId.getSeq(); -} - extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface* Math_XMLExporter_get_implementation(css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any> const&) diff --git a/sw/source/filter/xml/xmlexp.cxx b/sw/source/filter/xml/xmlexp.cxx index 65df1c99e243..8edb4f520785 100644 --- a/sw/source/filter/xml/xmlexp.cxx +++ b/sw/source/filter/xml/xmlexp.cxx @@ -508,18 +508,6 @@ void SwXMLExport::ExportContent_() GetTextParagraphExport()->exportText( xText, m_bShowProgress ); } -const Sequence< sal_Int8 > & SwXMLExport::getUnoTunnelId() noexcept -{ - static const comphelper::UnoIdInit theSwXMLExportUnoTunnelId; - return theSwXMLExportUnoTunnelId.getSeq(); -} - -sal_Int64 SAL_CALL SwXMLExport::getSomething( const Sequence< sal_Int8 >& rId ) -{ - return comphelper::getSomethingImpl(rId, this, - comphelper::FallbackToGetSomethingOf<SvXMLExport>{}); -} - SwDoc* SwXMLExport::getDoc() { if( m_pDoc != nullptr ) diff --git a/sw/source/filter/xml/xmlexp.hxx b/sw/source/filter/xml/xmlexp.hxx index 86b919ac95a7..f8cef9c40f76 100644 --- a/sw/source/filter/xml/xmlexp.hxx +++ b/sw/source/filter/xml/xmlexp.hxx @@ -130,10 +130,6 @@ public: bool IsShowProgress() const { return m_bShowProgress; } void SetShowProgress( bool b ) { m_bShowProgress = b; } - // XUnoTunnel - static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId() noexcept; - virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override; - const SwDoc* getDoc() const; SwDoc* getDoc(); }; diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx index 552b6edf8073..a6ae52092ec2 100644 --- a/xmloff/source/core/xmlexp.cxx +++ b/xmloff/source/core/xmlexp.cxx @@ -2017,9 +2017,6 @@ XMLImageMapExport& SvXMLExport::GetImageMapExport() return *mpImageMapExport; } -// XUnoTunnel & co -UNO3_GETIMPLEMENTATION_IMPL(SvXMLExport); - void SvXMLExport::ExportEmbeddedOwnObject( Reference< XComponent > const & rComp ) { OUString sFilterService;