Kaydet (Commit) ce1b932b authored tarafından Noel Grandin's avatar Noel Grandin

fdo#46808, don't cache the result of comphelper::getProcessComponentContext

Change-Id: I7eb3ce6794b5896ebc56d6f28f7e37b6929a6217
üst f95a7c2c
...@@ -526,9 +526,6 @@ public: ...@@ -526,9 +526,6 @@ public:
// #110680# // #110680#
::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > getServiceFactory(); ::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#) // Shapes in Writer cannot be named via context menu (#i51726#)
SvtModuleOptions::EFactory GetModelType() const SvtModuleOptions::EFactory GetModelType() const
{ {
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
#include <comphelper/stlunosequence.hxx> #include <comphelper/stlunosequence.hxx>
#include <comphelper/stl_types.hxx> #include <comphelper/stl_types.hxx>
#include <comphelper/processfactory.hxx>
#include <com/sun/star/uri/XUriReference.hpp> #include <com/sun/star/uri/XUriReference.hpp>
#include <com/sun/star/uri/UriReferenceFactory.hpp> #include <com/sun/star/uri/UriReferenceFactory.hpp>
...@@ -86,8 +87,7 @@ getRelativeReference(SvXMLExport const& rExport, ::rtl::OUString const& rURI) ...@@ -86,8 +87,7 @@ getRelativeReference(SvXMLExport const& rExport, ::rtl::OUString const& rURI)
rExport.GetModel(), uno::UNO_QUERY_THROW ); rExport.GetModel(), uno::UNO_QUERY_THROW );
::rtl::OUString const baseURI( xModelURI->getStringValue() ); ::rtl::OUString const baseURI( xModelURI->getStringValue() );
uno::Reference<uno::XComponentContext> const xContext( uno::Reference<uno::XComponentContext> xContext( comphelper::getProcessComponentContext() );
rExport.GetComponentContext());
uno::Reference<uri::XUriReferenceFactory> const xUriFactory = uno::Reference<uri::XUriReferenceFactory> const xUriFactory =
uri::UriReferenceFactory::create( xContext ); uri::UriReferenceFactory::create( xContext );
......
...@@ -265,8 +265,6 @@ public: ...@@ -265,8 +265,6 @@ public:
/// relative path of stream in package, e.g. "someobject/content.xml" /// relative path of stream in package, e.g. "someobject/content.xml"
::rtl::OUString mStreamPath; ::rtl::OUString mStreamPath;
const uno::Reference< uno::XComponentContext > mxComponentContext;
/// name of stream in package, e.g., "content.xml" /// name of stream in package, e.g., "content.xml"
::rtl::OUString mStreamName; ::rtl::OUString mStreamName;
...@@ -293,7 +291,6 @@ SvXMLExport_Impl::SvXMLExport_Impl() ...@@ -293,7 +291,6 @@ SvXMLExport_Impl::SvXMLExport_Impl()
// Written OpenDocument file format doesn't fit to the created text document (#i69627#) // Written OpenDocument file format doesn't fit to the created text document (#i69627#)
: mbOutlineStyleAsNormalListStyle( false ) : mbOutlineStyleAsNormalListStyle( false )
,mbSaveBackwardCompatibleODF( sal_True ) ,mbSaveBackwardCompatibleODF( sal_True )
,mxComponentContext( ::comphelper::getProcessComponentContext() )
,mStreamName() ,mStreamName()
,mNamespaceMaps() ,mNamespaceMaps()
,mDepth(0) ,mDepth(0)
...@@ -301,10 +298,7 @@ SvXMLExport_Impl::SvXMLExport_Impl() ...@@ -301,10 +298,7 @@ SvXMLExport_Impl::SvXMLExport_Impl()
,mbExportTextNumberElement( sal_False ) ,mbExportTextNumberElement( sal_False )
,mbNullDateInitialized( sal_False ) ,mbNullDateInitialized( sal_False )
{ {
OSL_ENSURE(mxComponentContext.is(), "SvXMLExport: no ComponentContext"); mxUriReferenceFactory = uri::UriReferenceFactory::create( comphelper::getProcessComponentContext() );
if (!mxComponentContext.is()) throw uno::RuntimeException();
mxUriReferenceFactory = uri::UriReferenceFactory::create(
mxComponentContext );
} }
//============================================================================== //==============================================================================
...@@ -430,8 +424,7 @@ void SvXMLExport::_InitCtor() ...@@ -430,8 +424,7 @@ void SvXMLExport::_InitCtor()
{ {
mpImpl->mbSaveBackwardCompatibleODF = mpImpl->mbSaveBackwardCompatibleODF =
officecfg::Office::Common::Save::Document:: officecfg::Office::Common::Save::Document::
SaveBackwardCompatibleODF::get( SaveBackwardCompatibleODF::get( comphelper::getProcessComponentContext() );
mpImpl->mxComponentContext);
} }
} }
...@@ -2377,12 +2370,6 @@ void SvXMLExport::DisposingModel() ...@@ -2377,12 +2370,6 @@ void SvXMLExport::DisposingModel()
return mxServiceFactory; return mxServiceFactory;
} }
uno::Reference< uno::XComponentContext >
SvXMLExport::GetComponentContext() const
{
return mpImpl->mxComponentContext;
}
::comphelper::UnoInterfaceToUniqueIdentifierMapper& SvXMLExport::getInterfaceToIdentifierMapper() ::comphelper::UnoInterfaceToUniqueIdentifierMapper& SvXMLExport::getInterfaceToIdentifierMapper()
{ {
return mpImpl->maInterfaceToIdentifierMapper; return mpImpl->maInterfaceToIdentifierMapper;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment