From 77897f5994bd18c3b771e51abce5ee6be01322fc Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Wed, 5 Sep 2012 09:47:35 +0200 Subject: 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 --- uui/source/iahndl-authentication.cxx | 4 +++- uui/source/passwordcontainer.cxx | 20 +++++++++----------- uui/source/passwordcontainer.hxx | 6 +++--- 3 files changed, 15 insertions(+), 15 deletions(-) (limited to 'uui') diff --git a/uui/source/iahndl-authentication.cxx b/uui/source/iahndl-authentication.cxx index 0a03af980cb5..6e03e22f1b04 100644 --- a/uui/source/iahndl-authentication.cxx +++ b/uui/source/iahndl-authentication.cxx @@ -17,6 +17,8 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include "comphelper/componentcontext.hxx" + #include "com/sun/star/task/DocumentPasswordRequest.hpp" #include "com/sun/star/task/DocumentPasswordRequest2.hpp" #include "com/sun/star/task/DocumentMSPasswordRequest.hpp" @@ -204,7 +206,7 @@ handleAuthenticationRequest_( ////////////////////////// // First, try to obtain credentials from password container service. - uui::PasswordContainerHelper aPwContainerHelper(xServiceFactory); + uui::PasswordContainerHelper aPwContainerHelper(comphelper::ComponentContext(xServiceFactory).getUNOContext()); if (aPwContainerHelper.handleAuthenticationRequest(rRequest, xSupplyAuthentication, rURL, 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 ); } diff --git a/uui/source/passwordcontainer.hxx b/uui/source/passwordcontainer.hxx index 61ee44bd5818..a755fc5115ec 100644 --- a/uui/source/passwordcontainer.hxx +++ b/uui/source/passwordcontainer.hxx @@ -49,8 +49,8 @@ class PasswordContainerHelper public: PasswordContainerHelper( com::sun::star::uno::Reference< - com::sun::star::lang::XMultiServiceFactory > const & - xServiceFactory ); + com::sun::star::uno::XComponentContext > const & + xContext ); // ------------------------------------------------------------------------ @@ -145,7 +145,7 @@ class PasswordContainerInteractionHandler : public: PasswordContainerInteractionHandler( const com::sun::star::uno::Reference< - com::sun::star::lang::XMultiServiceFactory >& rXSMgr ); + com::sun::star::uno::XComponentContext >& xContext ); virtual ~PasswordContainerInteractionHandler(); // XServiceInfo -- cgit ewer2 LibreOffice 核心代码仓库文档基金会
summaryrefslogtreecommitdiff
path: root/i18npool/Library_collator_data.mk
AgeCommit message (Expand)Author
2013-04-30Move to MPLv2 license headers, with ESC decision and author's permission.Michael Meeks
2012-09-28gbuild: invert handling of standard system libraries:Michael Stahl
2012-09-28gbuild: replace direct gb_STDLIBS use with ...Michael Stahl
2012-09-28gbuild: split uwinapi out of gb_STDLIBSMichael Stahl
2012-04-08gbuild: "use" vs. "add":Michael Stahl
2012-03-24i18npool: use CustomTarget_*.mk makefilesMatúš Kukan
2011-12-20Link most libs and executables with gb_STDLIBS as presumably is intendedTor Lillqvist