summaryrefslogtreecommitdiff
path: root/uui
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2012-09-05 09:47:35 +0200
committerStephan Bergmann <sbergman@redhat.com>2012-09-11 18:51:54 +0200
commit77897f5994bd18c3b771e51abce5ee6be01322fc (patch)
tree83e748eae69283ba5fde7ccc6bab32f23c34ad77 /uui
parenta9b9ffacac74310c38f152cb9bcc56fe06b0e1d6 (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')
-rw-r--r--uui/source/iahndl-authentication.cxx4
-rw-r--r--uui/source/passwordcontainer.cxx20
-rw-r--r--uui/source/passwordcontainer.hxx6
3 files changed, 15 insertions, 15 deletions
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