diff options
author | Noel Grandin <noel@peralex.com> | 2013-01-11 09:37:58 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2013-01-28 08:25:24 +0200 |
commit | ce1b932bba8f90363399a9fa6515b91d7d679efa (patch) | |
tree | c238927adc837ef15ebe47aaaf8c06ee0888809e /xmloff | |
parent | f95a7c2c6d5c2158de12bb3ca6fd94b139e33c62 (diff) |
fdo#46808, don't cache the result of comphelper::getProcessComponentContext
Change-Id: I7eb3ce6794b5896ebc56d6f28f7e37b6929a6217
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/inc/xmloff/xmlexp.hxx | 3 | ||||
-rw-r--r-- | xmloff/source/core/RDFaExportHelper.cxx | 4 | ||||
-rw-r--r-- | xmloff/source/core/xmlexp.cxx | 17 |
3 files changed, 4 insertions, 20 deletions
diff --git a/xmloff/inc/xmloff/xmlexp.hxx b/xmloff/inc/xmloff/xmlexp.hxx index a9ec4448825a..7482971c1614 100644 --- a/xmloff/inc/xmloff/xmlexp.hxx +++ b/xmloff/inc/xmloff/xmlexp.hxx @@ -526,9 +526,6 @@ public: // #110680# ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > getServiceFactory(); - ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > - GetComponentContext() const; - // Shapes in Writer cannot be named via context menu (#i51726#) SvtModuleOptions::EFactory GetModelType() const { diff --git a/xmloff/source/core/RDFaExportHelper.cxx b/xmloff/source/core/RDFaExportHelper.cxx index 052c76c82ecf..2b278b242ac0 100644 --- a/xmloff/source/core/RDFaExportHelper.cxx +++ b/xmloff/source/core/RDFaExportHelper.cxx @@ -27,6 +27,7 @@ #include <comphelper/stlunosequence.hxx> #include <comphelper/stl_types.hxx> +#include <comphelper/processfactory.hxx> #include <com/sun/star/uri/XUriReference.hpp> #include <com/sun/star/uri/UriReferenceFactory.hpp> @@ -86,8 +87,7 @@ getRelativeReference(SvXMLExport const& rExport, ::rtl::OUString const& rURI) rExport.GetModel(), uno::UNO_QUERY_THROW ); ::rtl::OUString const baseURI( xModelURI->getStringValue() ); - uno::Reference<uno::XComponentContext> const xContext( - rExport.GetComponentContext()); + uno::Reference<uno::XComponentContext> xContext( comphelper::getProcessComponentContext() ); uno::Reference<uri::XUriReferenceFactory> const xUriFactory = uri::UriReferenceFactory::create( xContext ); diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx index b51e8968f550..1ac34542f76c 100644 --- a/xmloff/source/core/xmlexp.cxx +++ b/xmloff/source/core/xmlexp.cxx @@ -265,8 +265,6 @@ public: /// relative path of stream in package, e.g. "someobject/content.xml" ::rtl::OUString mStreamPath; - const uno::Reference< uno::XComponentContext > mxComponentContext; - /// name of stream in package, e.g., "content.xml" ::rtl::OUString mStreamName; @@ -293,7 +291,6 @@ SvXMLExport_Impl::SvXMLExport_Impl() // Written OpenDocument file format doesn't fit to the created text document (#i69627#) : mbOutlineStyleAsNormalListStyle( false ) ,mbSaveBackwardCompatibleODF( sal_True ) - ,mxComponentContext( ::comphelper::getProcessComponentContext() ) ,mStreamName() ,mNamespaceMaps() ,mDepth(0) @@ -301,10 +298,7 @@ SvXMLExport_Impl::SvXMLExport_Impl() ,mbExportTextNumberElement( sal_False ) ,mbNullDateInitialized( sal_False ) { - OSL_ENSURE(mxComponentContext.is(), "SvXMLExport: no ComponentContext"); - if (!mxComponentContext.is()) throw uno::RuntimeException(); - mxUriReferenceFactory = uri::UriReferenceFactory::create( - mxComponentContext ); + mxUriReferenceFactory = uri::UriReferenceFactory::create( comphelper::getProcessComponentContext() ); } //============================================================================== @@ -430,8 +424,7 @@ void SvXMLExport::_InitCtor() { mpImpl->mbSaveBackwardCompatibleODF = officecfg::Office::Common::Save::Document:: - SaveBackwardCompatibleODF::get( - mpImpl->mxComponentContext); + SaveBackwardCompatibleODF::get( comphelper::getProcessComponentContext() ); } } @@ -2377,12 +2370,6 @@ void SvXMLExport::DisposingModel() return mxServiceFactory; } -uno::Reference< uno::XComponentContext > -SvXMLExport::GetComponentContext() const -{ - return mpImpl->mxComponentContext; -} - ::comphelper::UnoInterfaceToUniqueIdentifierMapper& SvXMLExport::getInterfaceToIdentifierMapper() { return mpImpl->maInterfaceToIdentifierMapper; |