From 2da149ff33b6ef345aef8619e06654e343c4e960 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Mon, 6 Jul 2020 16:31:00 +0200 Subject: uui: create instances with uno constructors See tdf#74608 for motivation Change-Id: I8b7eec5e2cbe61a8dc3bb65f391245c1825fedc2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98235 Tested-by: Jenkins Reviewed-by: Noel Grandin --- uui/source/passwordcontainer.cxx | 49 ++++++---------------------------------- 1 file changed, 7 insertions(+), 42 deletions(-) (limited to 'uui/source/passwordcontainer.cxx') diff --git a/uui/source/passwordcontainer.cxx b/uui/source/passwordcontainer.cxx index a97725ef1ca3..2e2d0b0ac3cb 100644 --- a/uui/source/passwordcontainer.cxx +++ b/uui/source/passwordcontainer.cxx @@ -292,7 +292,7 @@ PasswordContainerInteractionHandler::~PasswordContainerInteractionHandler() OUString SAL_CALL PasswordContainerInteractionHandler::getImplementationName() { - return getImplementationName_Static(); + return "com.sun.star.comp.uui.PasswordContainerInteractionHandler"; } @@ -309,24 +309,7 @@ PasswordContainerInteractionHandler::supportsService( uno::Sequence< OUString > SAL_CALL PasswordContainerInteractionHandler::getSupportedServiceNames() { - return getSupportedServiceNames_Static(); -} - - -// static -OUString -PasswordContainerInteractionHandler::getImplementationName_Static() -{ - return "com.sun.star.comp.uui.PasswordContainerInteractionHandler"; -} - - -// static -uno::Sequence< OUString > -PasswordContainerInteractionHandler::getSupportedServiceNames_Static() -{ - uno::Sequence< OUString > aSNS { "com.sun.star.task.PasswordContainerInteractionHandler" }; - return aSNS; + return { "com.sun.star.task.PasswordContainerInteractionHandler" }; } @@ -395,31 +378,13 @@ PasswordContainerInteractionHandler::handleInteractionRequest( } -// Service factory implementation. - -/// @throws uno::Exception -static uno::Reference< uno::XInterface > -PasswordContainerInteractionHandler_CreateInstance( - const uno::Reference< lang::XMultiServiceFactory> & rSMgr ) -{ - lang::XServiceInfo* pX - = new PasswordContainerInteractionHandler(comphelper::getComponentContext(rSMgr)); - return uno::Reference< uno::XInterface >::query( pX ); -} - +} // namespace uui -// static -uno::Reference< lang::XSingleServiceFactory > -PasswordContainerInteractionHandler::createServiceFactory( - const uno::Reference< lang::XMultiServiceFactory >& rxServiceMgr ) +extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface* +com_sun_star_comp_uui_PasswordContainerInteractionHandler_get_implementation( + css::uno::XComponentContext* context, css::uno::Sequence const&) { - return cppu::createOneInstanceFactory( - rxServiceMgr, - PasswordContainerInteractionHandler::getImplementationName_Static(), - PasswordContainerInteractionHandler_CreateInstance, - PasswordContainerInteractionHandler::getSupportedServiceNames_Static() ); + return cppu::acquire(new uui::PasswordContainerInteractionHandler(context)); } -} // namespace uui - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit