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:
// #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
{
......
......@@ -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 );
......
......@@ -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;
......
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