diff --git a/uui/Library_uui.mk b/uui/Library_uui.mk index f1dc84a4761c..4daad8403dcb 100644 --- a/uui/Library_uui.mk +++ b/uui/Library_uui.mk @@ -64,7 +64,6 @@ $(eval $(call gb_Library_add_exception_objects,uui,\ uui/source/passworddlg \ uui/source/requeststringresolver \ uui/source/secmacrowarnings \ - uui/source/services \ uui/source/sslwarndlg \ uui/source/trylater \ uui/source/unknownauthdlg \ 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 ); -} - - -// static -uno::Reference< lang::XSingleServiceFactory > -PasswordContainerInteractionHandler::createServiceFactory( - const uno::Reference< lang::XMultiServiceFactory >& rxServiceMgr ) -{ - return cppu::createOneInstanceFactory( - rxServiceMgr, - PasswordContainerInteractionHandler::getImplementationName_Static(), - PasswordContainerInteractionHandler_CreateInstance, - PasswordContainerInteractionHandler::getSupportedServiceNames_Static() ); -} - } // namespace uui +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::acquire(new uui::PasswordContainerInteractionHandler(context)); +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/uui/source/passwordcontainer.hxx b/uui/source/passwordcontainer.hxx index 2e2545fa6098..cb4d5a533507 100644 --- a/uui/source/passwordcontainer.hxx +++ b/uui/source/passwordcontainer.hxx @@ -150,16 +150,6 @@ public: virtual sal_Bool SAL_CALL handleInteractionRequest( const css::uno::Reference< css::task::XInteractionRequest >& Request ) override; - // Non-UNO interfaces - static OUString - getImplementationName_Static(); - - static css::uno::Sequence< OUString > - getSupportedServiceNames_Static(); - - static css::uno::Reference< css::lang::XSingleServiceFactory > - createServiceFactory( const css::uno::Reference< css::lang::XMultiServiceFactory > & rxServiceMgr ); - private: PasswordContainerHelper m_aPwContainerHelper; }; diff --git a/uui/source/services.cxx b/uui/source/services.cxx deleted file mode 100644 index 7709e41760a7..000000000000 --- a/uui/source/services.cxx +++ /dev/null @@ -1,63 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#include -#include -#include - -#include "passwordcontainer.hxx" - -using namespace com::sun::star::uno; -using namespace com::sun::star::lang; -using namespace com::sun::star::registry; - - -extern "C" SAL_DLLPUBLIC_EXPORT void * uui_component_getFactory(char const * pImplName, - void * pServiceManager, - void *) -{ - if (!pImplName) - return nullptr; - - void * pRet = nullptr; - - Reference< XMultiServiceFactory > xSMgr( - static_cast< XMultiServiceFactory * >( pServiceManager ) ); - Reference< XSingleServiceFactory > xFactory; - - // UUI Password Container Interaction Handler. - - if ( uui::PasswordContainerInteractionHandler::getImplementationName_Static(). - equalsAscii( pImplName ) ) - { - xFactory = - uui::PasswordContainerInteractionHandler::createServiceFactory( xSMgr ); - } - - - if ( xFactory.is() ) - { - xFactory->acquire(); - pRet = xFactory.get(); - } - - return pRet; -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/uui/util/uui.component b/uui/util/uui.component index b8a8087d1c63..1c3ae749e50f 100644 --- a/uui/util/uui.component +++ b/uui/util/uui.component @@ -18,9 +18,10 @@ --> + xmlns="http://openoffice.org/2010/uno-components"> + name="com.sun.star.comp.uui.PasswordContainerInteractionHandler" + constructor="com_sun_star_comp_uui_PasswordContainerInteractionHandler_get_implementation">