diff options
author | Noel Grandin <noel@peralex.com> | 2012-09-05 09:47:35 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2012-09-11 18:51:54 +0200 |
commit | 77897f5994bd18c3b771e51abce5ee6be01322fc (patch) | |
tree | 83e748eae69283ba5fde7ccc6bab32f23c34ad77 /uui/source/passwordcontainer.cxx | |
parent | a9b9ffacac74310c38f152cb9bcc56fe06b0e1d6 (diff) |
fdo#46808, Adapt task::PasswordContainer UNO service to new style
Create a merged XPasswordContainer2 interface for this service to implement.
Which is backwards-compatible, but does not require creating a new service.
Change-Id: I245b566b43e4646f10914b0aee13b2a0b0e296ae
Diffstat (limited to 'uui/source/passwordcontainer.cxx')
-rw-r--r-- | uui/source/passwordcontainer.cxx | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/uui/source/passwordcontainer.cxx b/uui/source/passwordcontainer.cxx index eec9c1045d68..bf54620cf342 100644 --- a/uui/source/passwordcontainer.cxx +++ b/uui/source/passwordcontainer.cxx @@ -17,9 +17,11 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include "comphelper/componentcontext.hxx" #include "cppuhelper/factory.hxx" #include "com/sun/star/lang/XMultiServiceFactory.hpp" +#include "com/sun/star/task/PasswordContainer.hpp" #include "com/sun/star/task/NoMasterException.hpp" #include "com/sun/star/task/XInteractionHandler.hpp" #include "com/sun/star/task/XMasterPasswordHandling.hpp" @@ -111,19 +113,15 @@ namespace uui { //========================================================================= PasswordContainerHelper::PasswordContainerHelper( - uno::Reference< lang::XMultiServiceFactory > const & xServiceFactory ) + uno::Reference< uno::XComponentContext > const & xContext ) { - OSL_ENSURE(xServiceFactory.is(), "no service factory given!"); - if (xServiceFactory.is()) + OSL_ENSURE(xContext.is(), "no service factory given!"); + if (xContext.is()) try { m_xPasswordContainer = uno::Reference< task::XPasswordContainer >( - xServiceFactory-> - createInstance( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( - "com.sun.star.task.PasswordContainer"))), + task::PasswordContainer::create(xContext), uno::UNO_QUERY); } catch (uno::Exception const &) @@ -308,8 +306,8 @@ bool PasswordContainerHelper::addRecord( //========================================================================= PasswordContainerInteractionHandler::PasswordContainerInteractionHandler( - const uno::Reference< lang::XMultiServiceFactory >& xSMgr ) -: m_aPwContainerHelper( xSMgr ) + const uno::Reference< uno::XComponentContext >& xContext ) +: m_aPwContainerHelper( xContext ) { } @@ -452,7 +450,7 @@ PasswordContainerInteractionHandler_CreateInstance( throw( uno::Exception ) { lang::XServiceInfo * pX = static_cast< lang::XServiceInfo * >( - new PasswordContainerInteractionHandler( rSMgr ) ); + new PasswordContainerInteractionHandler( comphelper::ComponentContext(rSMgr).getUNOContext() ) ); return uno::Reference< uno::XInterface >::query( pX ); } |