From 8172eaf8dcd2da6827f0a0445e98b947d0eac9be Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Mon, 11 Mar 2013 17:54:52 +0200 Subject: fdo#46808, use service constructor Change-Id: I349557ae5897ad668abab30b34b186e746b94c75 --- dbaccess/source/core/misc/sdbcoretools.cxx | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) (limited to 'dbaccess') diff --git a/dbaccess/source/core/misc/sdbcoretools.cxx b/dbaccess/source/core/misc/sdbcoretools.cxx index edee7a59faa3..490f1bb5957d 100644 --- a/dbaccess/source/core/misc/sdbcoretools.cxx +++ b/dbaccess/source/core/misc/sdbcoretools.cxx @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include #include @@ -86,18 +86,14 @@ namespace dbaccess try { - Reference< XInteractionRequestStringResolver > xStringResolver( - _rContext->getServiceManager()->createInstanceWithContext("com.sun.star.task.InteractionRequestStringResolver", _rContext), - UNO_QUERY ); - if ( xStringResolver.is() ) - { - ::rtl::Reference< ::comphelper::OInteractionRequest > pRequest( new ::comphelper::OInteractionRequest( _rError ) ); - ::rtl::Reference< ::comphelper::OInteractionApprove > pApprove( new ::comphelper::OInteractionApprove ); - pRequest->addContinuation( pApprove.get() ); - Optional< ::rtl::OUString > aMessage = xStringResolver->getStringFromInformationalRequest( pRequest.get() ); - if ( aMessage.IsPresent ) - sDisplayMessage = aMessage.Value; - } + Reference< XInteractionRequestStringResolver > xStringResolver = InteractionRequestStringResolver::create(_rContext); + + ::rtl::Reference< ::comphelper::OInteractionRequest > pRequest( new ::comphelper::OInteractionRequest( _rError ) ); + ::rtl::Reference< ::comphelper::OInteractionApprove > pApprove( new ::comphelper::OInteractionApprove ); + pRequest->addContinuation( pApprove.get() ); + Optional< ::rtl::OUString > aMessage = xStringResolver->getStringFromInformationalRequest( pRequest.get() ); + if ( aMessage.IsPresent ) + sDisplayMessage = aMessage.Value; } catch( const Exception& ) { -- cgit