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 /ucb | |
parent | f05d7abf93bbcf443cb0b5759ca19992e2fa85a3 (diff) |
Use comphelper::getComponentContext
...and some further clean up.
Change-Id: Id294c0f38fe0041646fc86cacbd2e19734c746a9
Diffstat (limited to 'ucb')
-rw-r--r-- | ucb/Library_ucphier1.mk | 1 | ||||
-rw-r--r-- | ucb/source/core/ucbcmds.cxx | 9 | ||||
-rw-r--r-- | ucb/source/ucp/hierarchy/hierarchyprovider.cxx | 28 | ||||
-rw-r--r-- | ucb/source/ucp/webdav/webdavcontent.cxx | 9 |
4 files changed, 13 insertions, 34 deletions
diff --git a/ucb/Library_ucphier1.mk b/ucb/Library_ucphier1.mk index 767fbd15208a..83798585807c 100644 --- a/ucb/Library_ucphier1.mk +++ b/ucb/Library_ucphier1.mk @@ -32,6 +32,7 @@ $(eval $(call gb_Library_set_componentfile,ucphier1,ucb/source/ucp/hierarchy/ucp $(eval $(call gb_Library_use_sdk_api,ucphier1)) $(eval $(call gb_Library_use_libraries,ucphier1,\ + comphelper \ cppu \ cppuhelper \ sal \ diff --git a/ucb/source/core/ucbcmds.cxx b/ucb/source/core/ucbcmds.cxx index 0f6794b59b1c..4585efb6a3e3 100644 --- a/ucb/source/core/ucbcmds.cxx +++ b/ucb/source/core/ucbcmds.cxx @@ -41,7 +41,6 @@ #include <com/sun/star/uno/XInterface.hpp> #include <com/sun/star/beans/PropertyState.hpp> #include <com/sun/star/beans/PropertyValue.hpp> -#include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/container/XChild.hpp> #include <com/sun/star/beans/XPropertySetInfo.hpp> #include <com/sun/star/io/Pipe.hpp> @@ -1705,12 +1704,8 @@ void UniversalContentBroker::globalTransfer( uno::Reference< ucb::XCommandEnvironment > xLocalEnv; if (xEnv.is()) { - uno::Reference< beans::XPropertySet > const xProps( - m_xSMgr, uno::UNO_QUERY_THROW ); - uno::Reference< uno::XComponentContext > xCtx; - xCtx.set( xProps->getPropertyValue( - rtl::OUString( "DefaultContext" ) ), - uno::UNO_QUERY_THROW ); + uno::Reference< uno::XComponentContext > xCtx( + comphelper::getComponentContext( m_xSMgr ) ); xLocalEnv.set( ucb::CommandEnvironment::create( xCtx, diff --git a/ucb/source/ucp/hierarchy/hierarchyprovider.cxx b/ucb/source/ucp/hierarchy/hierarchyprovider.cxx index cf0db7a82a90..dfed6f6600be 100644 --- a/ucb/source/ucp/hierarchy/hierarchyprovider.cxx +++ b/ucb/source/ucp/hierarchy/hierarchyprovider.cxx @@ -36,9 +36,9 @@ *************************************************************************/ #include <osl/diagnose.h> #include <com/sun/star/beans/PropertyValue.hpp> -#include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/container/XHierarchicalNameAccess.hpp> #include <com/sun/star/util/XOfficeInstallationDirectories.hpp> +#include <comphelper/processfactory.hxx> #include <ucbhelper/contentidentifier.hxx> #include "hierarchyprovider.hxx" #include "hierarchycontent.hxx" @@ -279,30 +279,16 @@ HierarchyContentProvider::getOfficeInstallationDirectories() { OSL_ENSURE( m_xSMgr.is(), "No service manager!" ); - uno::Reference< uno::XComponentContext > xCtx; - uno::Reference< beans::XPropertySet > xPropSet( - m_xSMgr, uno::UNO_QUERY ); - if ( xPropSet.is() ) - { - xPropSet->getPropertyValue( - rtl::OUString( "DefaultContext" ) ) - >>= xCtx; - } - - OSL_ENSURE( xCtx.is(), - "Unable to obtain component context from " - "service manager!" ); + uno::Reference< uno::XComponentContext > xCtx( + comphelper::getComponentContext( m_xSMgr ) ); - if ( xCtx.is() ) - { - xCtx->getValueByName( - rtl::OUString( "/singletons/com.sun.star.util.theOfficeInstallationDirectories" ) ) + xCtx->getValueByName( + rtl::OUString( "/singletons/com.sun.star.util.theOfficeInstallationDirectories" ) ) >>= m_xOfficeInstDirs; // Be silent. singleton only available in an Office environment. -// 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; diff --git a/ucb/source/ucp/webdav/webdavcontent.cxx b/ucb/source/ucp/webdav/webdavcontent.cxx index 64a369a40548..bfabf8cedfac 100644 --- a/ucb/source/ucp/webdav/webdavcontent.cxx +++ b/ucb/source/ucp/webdav/webdavcontent.cxx @@ -33,6 +33,7 @@ *************************************************************************/ +#include <comphelper/processfactory.hxx> #include <osl/diagnose.h> #include "osl/doublecheckedlocking.h" #include <rtl/uri.hxx> @@ -199,12 +200,8 @@ uno::Any SAL_CALL Content::queryInterface( const uno::Type & rType ) { try { - uno::Reference< beans::XPropertySet > const xProps( - m_xSMgr, uno::UNO_QUERY_THROW ); - uno::Reference< uno::XComponentContext > xCtx; - xCtx.set( xProps->getPropertyValue( - rtl::OUString( "DefaultContext" ) ), - uno::UNO_QUERY_THROW ); + uno::Reference< uno::XComponentContext > xCtx( + comphelper::getComponentContext( m_xSMgr ) ); uno::Reference< task::XInteractionHandler > xIH( task::PasswordContainerInteractionHandler::create( xCtx ) ); |