diff options
author | Matúš Kukan <matus.kukan@gmail.com> | 2016-09-07 20:10:26 +0200 |
---|---|---|
committer | Matúš Kukan <matus.kukan@gmail.com> | 2016-10-13 20:26:24 +0200 |
commit | 22b0c09f8463b9c6cceb9e2c3addcab79d42aa0b (patch) | |
tree | cfb7d6401c2c0d77c9949cb4bf4281b4301c4ef7 /uui | |
parent | 3b6f7f38100c9c9d799756ffddbf281bf49364f4 (diff) |
tdf#74608: Ctor function for css.comp.uui.UUIInteractionRequestStringResolver
Change-Id: I42c0c2cc8797647aa9dd676034137a1430e42fee
Diffstat (limited to 'uui')
-rw-r--r-- | uui/source/requeststringresolver.cxx | 33 | ||||
-rw-r--r-- | uui/source/requeststringresolver.hxx | 16 | ||||
-rw-r--r-- | uui/source/services.cxx | 22 | ||||
-rw-r--r-- | uui/util/uui.component | 4 |
4 files changed, 13 insertions, 62 deletions
diff --git a/uui/source/requeststringresolver.cxx b/uui/source/requeststringresolver.cxx index d2ed7dc9b7c9..b63b0358f988 100644 --- a/uui/source/requeststringresolver.cxx +++ b/uui/source/requeststringresolver.cxx @@ -19,7 +19,6 @@ #include "requeststringresolver.hxx" #include "iahndl.hxx" -#include <comphelper/processfactory.hxx> #include <cppuhelper/supportsservice.hxx> using namespace css; @@ -39,7 +38,7 @@ OUString SAL_CALL UUIInteractionRequestStringResolver::getImplementationName() throw (uno::RuntimeException, std::exception) { - return OUString::createFromAscii(m_aImplementationName); + return OUString("com.sun.star.comp.uui.UUIInteractionRequestStringResolver"); } sal_Bool SAL_CALL @@ -50,11 +49,12 @@ UUIInteractionRequestStringResolver::supportsService( return cppu::supportsService(this, rServiceName); } + uno::Sequence< OUString > SAL_CALL UUIInteractionRequestStringResolver::getSupportedServiceNames() throw (uno::RuntimeException, std::exception) { - return getSupportedServiceNames_static(); + return { "com.sun.star.task.InteractionRequestStringResolver" }; } beans::Optional< OUString > SAL_CALL @@ -73,29 +73,12 @@ UUIInteractionRequestStringResolver::getStringFromInformationalRequest( } } -char const UUIInteractionRequestStringResolver::m_aImplementationName[] - = "com.sun.star.comp.uui.UUIInteractionRequestStringResolver"; - -uno::Sequence< OUString > -UUIInteractionRequestStringResolver::getSupportedServiceNames_static() -{ - uno::Sequence< OUString > aNames { "com.sun.star.task.InteractionRequestStringResolver" }; - return aNames; -} - -uno::Reference< uno::XInterface > SAL_CALL -UUIInteractionRequestStringResolver::createInstance( - uno::Reference< lang::XMultiServiceFactory > const & - rServiceFactory) +extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL +com_sun_star_comp_uui_UUIInteractionRequestStringResolver_get_implementation( + css::uno::XComponentContext *context, + css::uno::Sequence<css::uno::Any> const &) { - try - { - return *new UUIInteractionRequestStringResolver(comphelper::getComponentContext(rServiceFactory)); - } - catch (std::bad_alloc const &) - { - throw uno::RuntimeException("out of memory", nullptr); - } + return cppu::acquire(new UUIInteractionRequestStringResolver(context)); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/uui/source/requeststringresolver.hxx b/uui/source/requeststringresolver.hxx index 4ebbee0d3ce0..e6dc745f2ab7 100644 --- a/uui/source/requeststringresolver.hxx +++ b/uui/source/requeststringresolver.hxx @@ -21,7 +21,6 @@ #define INCLUDED_UUI_SOURCE_REQUESTSTRINGRESOLVER_HXX #include <com/sun/star/lang/XServiceInfo.hpp> -#include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/task/XInteractionRequestStringResolver.hpp> #include <com/sun/star/uno/XComponentContext.hpp> #include <cppuhelper/implbase.hxx> @@ -35,16 +34,8 @@ class UUIInteractionRequestStringResolver: css::task::XInteractionRequestStringResolver > { public: - static char const m_aImplementationName[]; - - static css::uno::Sequence< OUString > - getSupportedServiceNames_static(); - - static css::uno::Reference< css::uno::XInterface > - SAL_CALL - createInstance( - css::uno::Reference< css::lang::XMultiServiceFactory > const & - rServiceFactory); + explicit UUIInteractionRequestStringResolver( + css::uno::Reference< css::uno::XComponentContext > const & rxContext); private: std::unique_ptr<UUIInteractionHelper> m_pImpl; @@ -52,9 +43,6 @@ private: UUIInteractionRequestStringResolver(UUIInteractionRequestStringResolver &) = delete; void operator =(UUIInteractionRequestStringResolver&) = delete; - explicit UUIInteractionRequestStringResolver( - css::uno::Reference< css::uno::XComponentContext > const & rxContext); - virtual ~UUIInteractionRequestStringResolver() override; virtual OUString SAL_CALL getImplementationName() diff --git a/uui/source/services.cxx b/uui/source/services.cxx index e914508227a9..052658aac19c 100644 --- a/uui/source/services.cxx +++ b/uui/source/services.cxx @@ -24,7 +24,6 @@ #include <sal/types.h> #include <uno/environment.h> -#include "requeststringresolver.hxx" #include "passwordcontainer.hxx" using namespace com::sun::star::uno; @@ -45,28 +44,9 @@ extern "C" SAL_DLLPUBLIC_EXPORT void * SAL_CALL uui_component_getFactory(sal_Cha static_cast< XMultiServiceFactory * >( pServiceManager ) ); Reference< XSingleServiceFactory > xFactory; - - // UUI Interaction Request String Resolver. - - - if ( rtl_str_compare(pImplName, - UUIInteractionRequestStringResolver::m_aImplementationName) - == 0) - { - xFactory = - cppu::createSingleFactory( - static_cast< XMultiServiceFactory * >(pServiceManager), - OUString::createFromAscii( - UUIInteractionRequestStringResolver::m_aImplementationName), - &UUIInteractionRequestStringResolver::createInstance, - UUIInteractionRequestStringResolver::getSupportedServiceNames_static()); - } - - // UUI Password Container Interaction Handler. - - else if ( uui::PasswordContainerInteractionHandler::getImplementationName_Static(). + if ( uui::PasswordContainerInteractionHandler::getImplementationName_Static(). equalsAscii( pImplName ) ) { xFactory = diff --git a/uui/util/uui.component b/uui/util/uui.component index 89898799f18d..b8a8087d1c63 100644 --- a/uui/util/uui.component +++ b/uui/util/uui.component @@ -29,8 +29,8 @@ <service name="com.sun.star.task.InteractionHandler"/> <service name="com.sun.star.uui.InteractionHandler"/> </implementation> - <implementation - name="com.sun.star.comp.uui.UUIInteractionRequestStringResolver"> + <implementation name="com.sun.star.comp.uui.UUIInteractionRequestStringResolver" + constructor="com_sun_star_comp_uui_UUIInteractionRequestStringResolver_get_implementation"> <service name="com.sun.star.task.InteractionRequestStringResolver"/> </implementation> </component> |