summaryrefslogtreecommitdiff
path: root/basic/source/uno/namecont.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2013-05-13 16:51:26 +0200
committerNoel Grandin <noel@peralex.com>2013-05-14 08:08:27 +0200
commit4460f213df777f569fa2a2091885c29c7653637f (patch)
treefb2f12ff84bcfddb53ca0889d01541ee31176ffa /basic/source/uno/namecont.cxx
parent67042f1f0314da51dbea6602ddcdd0a4ab347bc7 (diff)
fdo#46808, use XComponentContext in SfxLibraryContainer
Change-Id: I6f66fc69a40e2cd2ef2372e0413ff95b6202c5c5
Diffstat (limited to 'basic/source/uno/namecont.cxx')
-rw-r--r--basic/source/uno/namecont.cxx20
1 files changed, 9 insertions, 11 deletions
diff --git a/basic/source/uno/namecont.cxx b/basic/source/uno/namecont.cxx
index 2e0a8f2b8263..69e8fbfbd9e8 100644
--- a/basic/source/uno/namecont.cxx
+++ b/basic/source/uno/namecont.cxx
@@ -387,12 +387,11 @@ SfxLibraryContainer::SfxLibraryContainer( void )
{
DBG_CTOR( SfxLibraryContainer, NULL );
- mxMSF = comphelper::getProcessServiceFactory();
- SAL_WARN_IF(!mxMSF.is(), "basic", "couldn't get ProcessServiceFactory");
+ mxContext = comphelper::getProcessComponentContext();
- mxSFI = ucb::SimpleFileAccess::create( comphelper::getComponentContext(mxMSF) );
+ mxSFI = ucb::SimpleFileAccess::create( mxContext );
- mxStringSubstitution = util::PathSubstitution::create( comphelper::getComponentContext(mxMSF) );
+ mxStringSubstitution = util::PathSubstitution::create( mxContext );
}
SfxLibraryContainer::~SfxLibraryContainer()
@@ -686,7 +685,7 @@ void SfxLibraryContainer::init_Impl( const OUString& rInitialDocumentURL,
maLibraryPath = SvtPathOptions().GetBasicPath();
}
- Reference< XParser > xParser = xml::sax::Parser::create(comphelper::getComponentContext(mxMSF));
+ Reference< XParser > xParser = xml::sax::Parser::create(mxContext);
uno::Reference< io::XInputStream > xInput;
@@ -1578,7 +1577,7 @@ void SfxLibraryContainer::implStoreLibraryIndexFile( SfxLibrary* pLib,
Reference< XSimpleFileAccess3 > xToUseSFI )
{
// Create sax writer
- Reference< XWriter > xWriter = xml::sax::Writer::create(comphelper::getComponentContext(mxMSF));
+ Reference< XWriter > xWriter = xml::sax::Writer::create(mxContext);
sal_Bool bLink = pLib->mbLink;
bool bStorage = xStorage.is() && !bLink;
@@ -1678,7 +1677,7 @@ bool SfxLibraryContainer::implLoadLibraryIndexFile( SfxLibrary* pLib,
const uno::Reference< embed::XStorage >& xStorage,
const OUString& aIndexFileName )
{
- Reference< XParser > xParser = xml::sax::Parser::create(comphelper::getComponentContext(mxMSF));
+ Reference< XParser > xParser = xml::sax::Parser::create(mxContext);
sal_Bool bLink = sal_False;
bool bStorage = false;
@@ -2051,7 +2050,7 @@ void SfxLibraryContainer::storeLibraries_Impl( const uno::Reference< embed::XSto
// Write library container info
// Create sax writer
- Reference< XWriter > xWriter = xml::sax::Writer::create(comphelper::getComponentContext(mxMSF));
+ Reference< XWriter > xWriter = xml::sax::Writer::create(mxContext);
// Write info file
uno::Reference< io::XOutputStream > xOut;
@@ -2800,7 +2799,7 @@ void SAL_CALL SfxLibraryContainer::exportLibrary( const OUString& Name, const OU
Reference< XSimpleFileAccess3 > xToUseSFI;
if( Handler.is() )
{
- xToUseSFI = ucb::SimpleFileAccess::create( comphelper::getComponentContext(mxMSF) );
+ xToUseSFI = ucb::SimpleFileAccess::create( mxContext );
xToUseSFI->setInteractionHandler( Handler );
}
@@ -2834,8 +2833,7 @@ OUString SfxLibraryContainer::expand_url( const OUString& url )
{
if( !mxMacroExpander.is() )
{
- Reference< XComponentContext > xContext(comphelper::getComponentContext( mxMSF ) );
- Reference< util::XMacroExpander > xExpander = util::theMacroExpander::get(xContext);
+ Reference< util::XMacroExpander > xExpander = util::theMacroExpander::get(mxContext);
MutexGuard guard( Mutex::getGlobalMutex() );
if( !mxMacroExpander.is() )
{