diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2020-07-26 10:42:37 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-07-26 13:41:59 +0200 |
commit | 38bccb6928aaf4ed7eb2e146579fc0cf2446dc17 (patch) | |
tree | d3445a122cab2b0e0923695210bc4cf62f7c8a16 /xmloff | |
parent | 5935dd32a445acd1b2625acda2f02b7d0debed97 (diff) |
sc: create instances with uno constructors
See tdf#74608 for motivation.
Change-Id: Id4bf552c6a2580742bf46ccf6cdd2e09b0dbdebc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99455
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/source/core/xmlimp.cxx | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx index 940fc20eaa73..9aca2c429b90 100644 --- a/xmloff/source/core/xmlimp.cxx +++ b/xmloff/source/core/xmlimp.cxx @@ -288,6 +288,7 @@ public: const uno::Reference< uno::XComponentContext > mxComponentContext; OUString implementationName; + css::uno::Sequence< OUString > maSupportedServiceNames; uno::Reference< embed::XStorage > mxSourceStorage; @@ -296,7 +297,8 @@ public: std::unique_ptr< DocumentInfo > mpDocumentInfo; SvXMLImport_Impl( const uno::Reference< uno::XComponentContext >& rxContext, - OUString const & theImplementationName) + OUString const & theImplementationName, + const css::uno::Sequence< OUString > & sSupportedServiceNames = {}) : hBatsFontConv( nullptr ) , hMathFontConv( nullptr ) , mbOwnGraphicResolver( false ) @@ -307,11 +309,14 @@ public: , mbTextDocInOOoFileFormat( false ) , mxComponentContext( rxContext ) , implementationName(theImplementationName) + , maSupportedServiceNames(sSupportedServiceNames) , mpRDFaHelper() // lazy , mpDocumentInfo() // lazy { SAL_WARN_IF(!mxComponentContext.is(), "xmloff.core", "SvXMLImport: no ComponentContext"); if (!mxComponentContext.is()) throw uno::RuntimeException(); + if (!maSupportedServiceNames.hasElements()) + maSupportedServiceNames = { "com.sun.star.document.ImportFilter", "com.sun.star.xml.XMLImportFilter" }; } sal_uInt16 getGeneratorVersion( const SvXMLImport& rImport ) @@ -390,8 +395,10 @@ void SvXMLImport::InitCtor_() SvXMLImport::SvXMLImport( const css::uno::Reference< css::uno::XComponentContext >& xContext, - OUString const & implementationName, SvXMLImportFlags nImportFlags ) -: mpImpl( new SvXMLImport_Impl(xContext, implementationName) ), + OUString const & implementationName, + SvXMLImportFlags nImportFlags, + const css::uno::Sequence< OUString > & sSupportedServiceNames ) +: mpImpl( new SvXMLImport_Impl(xContext, implementationName, sSupportedServiceNames) ), mpNamespaceMap( new SvXMLNamespaceMap ), mpUnitConv( new SvXMLUnitConverter( xContext, @@ -1150,7 +1157,7 @@ sal_Bool SAL_CALL SvXMLImport::supportsService( const OUString& rServiceName ) uno::Sequence< OUString > SAL_CALL SvXMLImport::getSupportedServiceNames( ) { - return { "com.sun.star.document.ImportFilter", "com.sun.star.xml.XMLImportFilter" }; + return mpImpl->maSupportedServiceNames; } XMLTextImportHelper* SvXMLImport::CreateTextImport() |