summaryrefslogtreecommitdiff
path: root/comphelper
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2012-09-29 17:20:22 +0200
committerStephan Bergmann <sbergman@redhat.com>2012-09-29 18:18:28 +0200
commitc2ca6fabd1afc3fc07001721c2069d3c8db7000a (patch)
tree350741d6d19564bcaf00506bd7d22b4c644e0fdc /comphelper
parentf05d7abf93bbcf443cb0b5759ca19992e2fa85a3 (diff)
Use comphelper::getComponentContext
...and some further clean up. Change-Id: Id294c0f38fe0041646fc86cacbd2e19734c746a9
Diffstat (limited to 'comphelper')
-rw-r--r--comphelper/source/misc/componentcontext.cxx23
1 files changed, 3 insertions, 20 deletions
diff --git a/comphelper/source/misc/componentcontext.cxx b/comphelper/source/misc/componentcontext.cxx
index df7db6a16185..8ec65d33542e 100644
--- a/comphelper/source/misc/componentcontext.cxx
+++ b/comphelper/source/misc/componentcontext.cxx
@@ -18,7 +18,7 @@
*/
#include <comphelper/componentcontext.hxx>
-
+#include <comphelper/processfactory.hxx>
#include <com/sun/star/lang/NullPointerException.hpp>
#include <com/sun/star/lang/ServiceNotRegisteredException.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
@@ -53,8 +53,6 @@ namespace comphelper
{
if ( m_xContext.is() )
m_xORB = m_xContext->getServiceManager();
- if ( !m_xORB.is() )
- throw NullPointerException();
}
//------------------------------------------------------------------------
@@ -63,23 +61,8 @@ namespace comphelper
if ( !_rxLegacyFactory.is() )
throw NullPointerException();
- try
- {
- Reference< XPropertySet > xFactoryProperties( _rxLegacyFactory, UNO_QUERY_THROW );
- m_xContext = Reference< XComponentContext >(
- xFactoryProperties->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultContext" ) ) ),
- UNO_QUERY );
- }
- catch( const RuntimeException& ) { throw; }
- catch( const Exception& )
- {
- throw RuntimeException();
- }
-
- if ( m_xContext.is() )
- m_xORB = m_xContext->getServiceManager();
- if ( !m_xORB.is() )
- throw NullPointerException();
+ m_xContext = comphelper::getComponentContext( _rxLegacyFactory );
+ m_xORB = m_xContext->getServiceManager();
}
//------------------------------------------------------------------------