diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2012-09-29 17:20:22 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2012-09-29 18:18:28 +0200 |
commit | c2ca6fabd1afc3fc07001721c2069d3c8db7000a (patch) | |
tree | 350741d6d19564bcaf00506bd7d22b4c644e0fdc /svtools/source/misc | |
parent | f05d7abf93bbcf443cb0b5759ca19992e2fa85a3 (diff) |
Use comphelper::getComponentContext
...and some further clean up.
Change-Id: Id294c0f38fe0041646fc86cacbd2e19734c746a9
Diffstat (limited to 'svtools/source/misc')
-rw-r--r-- | svtools/source/misc/templatefoldercache.cxx | 36 |
1 files changed, 7 insertions, 29 deletions
diff --git a/svtools/source/misc/templatefoldercache.cxx b/svtools/source/misc/templatefoldercache.cxx index 139d84ad7336..b49d74aa0648 100644 --- a/svtools/source/misc/templatefoldercache.cxx +++ b/svtools/source/misc/templatefoldercache.cxx @@ -29,7 +29,6 @@ #include <svtools/templatefoldercache.hxx> #include <unotools/ucbstreamhelper.hxx> #include <unotools/localfilehelper.hxx> -#include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/sdbc/XResultSet.hpp> #include <com/sun/star/ucb/XDynamicResultSet.hpp> #include <com/sun/star/sdbc/XRow.hpp> @@ -837,36 +836,15 @@ namespace svt osl::MutexGuard aGuard( m_aMutex ); if ( !m_xOfficeInstDirs.is() ) { - // @@@ This is bad! - uno::Reference< lang::XMultiServiceFactory > xSMgr - = comphelper::getProcessServiceFactory(); - OSL_ENSURE( xSMgr.is(), "No service manager!" ); - - uno::Reference< beans::XPropertySet > xPropSet( - xSMgr, uno::UNO_QUERY ); - if ( xPropSet.is() ) - { - uno::Reference< uno::XComponentContext > xCtx; - xPropSet->getPropertyValue( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "DefaultContext" ) ) ) - >>= xCtx; - - OSL_ENSURE( xCtx.is(), - "Unable to obtain component context from service manager!" ); - - if ( xCtx.is() ) - { - xCtx->getValueByName( - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( + uno::Reference< uno::XComponentContext > xCtx( + comphelper::getProcessComponentContext() ); + xCtx->getValueByName( + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/singletons/com.sun.star.util.theOfficeInstallationDirectories" ) ) ) - >>= m_xOfficeInstDirs; - } + >>= m_xOfficeInstDirs; - OSL_ENSURE( m_xOfficeInstDirs.is(), - "Unable to obtain office directories singleton!" ); - - } + OSL_ENSURE( m_xOfficeInstDirs.is(), + "Unable to obtain office directories singleton!" ); } } return m_xOfficeInstDirs; |