diff options
Diffstat (limited to 'sfx2/source/doc/objserv.cxx')
-rw-r--r-- | sfx2/source/doc/objserv.cxx | 32 |
1 files changed, 12 insertions, 20 deletions
diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx index 443294aafafd..c6caa28ff4c3 100644 --- a/sfx2/source/doc/objserv.cxx +++ b/sfx2/source/doc/objserv.cxx @@ -29,7 +29,7 @@ #include <com/sun/star/beans/PropertyValue.hpp> #include <com/sun/star/container/XNameAccess.hpp> #include <com/sun/star/document/XExporter.hpp> -#include <com/sun/star/task/XInteractionHandler.hpp> +#include <com/sun/star/task/InteractionHandler.hpp> #include <com/sun/star/task/XStatusIndicator.hpp> #include <com/sun/star/task/XStatusIndicatorFactory.hpp> #include <com/sun/star/frame/DocumentTemplates.hpp> @@ -554,28 +554,20 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq) SFX_REQUEST_ARG( rReq, pInteractionHandlerItem, SfxUnoAnyItem, SID_INTERACTIONHANDLER, sal_False ); if ( !pInteractionHandlerItem ) { - uno::Reference< task::XInteractionHandler > xInteract; - uno::Reference< lang::XMultiServiceFactory > xServiceManager = ::comphelper::getProcessServiceFactory(); - if( xServiceManager.is() ) - { - xInteract = Reference< XInteractionHandler >( - xServiceManager->createInstance( DEFINE_CONST_UNICODE("com.sun.star.task.InteractionHandler") ), - UNO_QUERY ); - } + uno::Reference< uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext(); + uno::Reference< task::XInteractionHandler > xInteract( + task::InteractionHandler::createDefault(xContext), + UNO_QUERY_THROW ); - OSL_ENSURE( xInteract.is(), "Can not retrieve default status indicator!\n" ); - if ( xInteract.is() ) + SfxUnoAnyItem aInteractionItem( SID_INTERACTIONHANDLER, uno::makeAny( xInteract ) ); + if ( nId == SID_SAVEDOC ) { - SfxUnoAnyItem aInteractionItem( SID_INTERACTIONHANDLER, uno::makeAny( xInteract ) ); - if ( nId == SID_SAVEDOC ) - { - // in case of saving it is not possible to transport the parameters from here - // but it is not clear here whether the saving will be done or saveAs operation - GetMedium()->GetItemSet()->Put( aInteractionItem ); - } - - rReq.AppendItem( aInteractionItem ); + // in case of saving it is not possible to transport the parameters from here + // but it is not clear here whether the saving will be done or saveAs operation + GetMedium()->GetItemSet()->Put( aInteractionItem ); } + + rReq.AppendItem( aInteractionItem ); } else if ( nId == SID_SAVEDOC ) { |