summaryrefslogtreecommitdiff
path: root/svtools/source/hatchwindow
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 /svtools/source/hatchwindow
parentf05d7abf93bbcf443cb0b5759ca19992e2fa85a3 (diff)
Use comphelper::getComponentContext
...and some further clean up. Change-Id: Id294c0f38fe0041646fc86cacbd2e19734c746a9
Diffstat (limited to 'svtools/source/hatchwindow')
-rw-r--r--svtools/source/hatchwindow/documentcloser.cxx17
1 files changed, 3 insertions, 14 deletions
diff --git a/svtools/source/hatchwindow/documentcloser.cxx b/svtools/source/hatchwindow/documentcloser.cxx
index fe934549d202..0cf4d7d120fd 100644
--- a/svtools/source/hatchwindow/documentcloser.cxx
+++ b/svtools/source/hatchwindow/documentcloser.cxx
@@ -22,9 +22,8 @@
#include <com/sun/star/lang/DisposedException.hpp>
#include <com/sun/star/lang/IllegalArgumentException.hpp>
#include <com/sun/star/frame/DoubleInitializationException.hpp>
-#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/awt/XVclWindowPeer.hpp>
-
+#include <comphelper/processfactory.hxx>
#include <osl/mutex.hxx>
#include <vcl/svapp.hxx>
#include <vcl/dialog.hxx>
@@ -267,18 +266,8 @@ uno::Sequence< ::rtl::OUString > SAL_CALL ODocumentCloser::impl_staticGetSupport
uno::Reference< uno::XInterface > SAL_CALL ODocumentCloser::impl_staticCreateSelfInstance(
const uno::Reference< lang::XMultiServiceFactory >& xServiceManager )
{
- uno::Reference< uno::XComponentContext > xContext;
- uno::Reference< beans::XPropertySet > xPropSet( xServiceManager, uno::UNO_QUERY );
- if ( xPropSet.is() )
- xPropSet->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultContext" ) ) ) >>= xContext;
-
- if ( !xContext.is() )
- {
- throw uno::RuntimeException(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Unable to obtain component context from service manager!" ) ),
- uno::Reference< uno::XInterface >() );
- }
-
+ uno::Reference< uno::XComponentContext > xContext(
+ comphelper::getComponentContext( xServiceManager ) );
return static_cast< cppu::OWeakObject * >( new ODocumentCloser( xContext ) );
}