From 3099c70b11c7e5b80fe4dbe3dc99171fb38c6fc2 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Tue, 17 Mar 2015 12:25:11 +0100 Subject: Fix various XServiceInfo implementations ...to match what is recorded in the .component files Change-Id: Ie548cd37872d3b8540222201afaac73040e65c8f --- forms/source/xforms/model.cxx | 18 ++++++++++++++++++ forms/source/xforms/model.hxx | 16 +++++++++++++--- forms/source/xforms/xforms_services.cxx | 27 ++++++++++++++++++++++++++- 3 files changed, 57 insertions(+), 4 deletions(-) (limited to 'forms/source/xforms') diff --git a/forms/source/xforms/model.cxx b/forms/source/xforms/model.cxx index e428d451fcd0..c6774ddc0488 100644 --- a/forms/source/xforms/model.cxx +++ b/forms/source/xforms/model.cxx @@ -36,6 +36,7 @@ #include #include +#include #include #include @@ -680,6 +681,23 @@ Sequence Model::getImplementationId() return css::uno::Sequence(); } +OUString Model::getImplementationName() + throw (css::uno::RuntimeException, std::exception) +{ + return OUString("com.sun.star.form.Model"); +} + +sal_Bool Model::supportsService(OUString const & ServiceName) + throw (css::uno::RuntimeException, std::exception) +{ + return cppu::supportsService(this, ServiceName); +} + +css::uno::Sequence Model::getSupportedServiceNames() + throw (css::uno::RuntimeException, std::exception) +{ + return css::uno::Sequence{"com.sun.star.xforms.Model"}; +} extern "C" SAL_DLLPUBLIC_EXPORT ::com::sun::star::uno::XInterface* SAL_CALL com_sun_star_form_Model_get_implementation(::com::sun::star::uno::XComponentContext*, diff --git a/forms/source/xforms/model.hxx b/forms/source/xforms/model.hxx index 0d8b962414e5..2ae00816a163 100644 --- a/forms/source/xforms/model.hxx +++ b/forms/source/xforms/model.hxx @@ -20,11 +20,12 @@ #ifndef INCLUDED_FORMS_SOURCE_XFORMS_MODEL_HXX #define INCLUDED_FORMS_SOURCE_XFORMS_MODEL_HXX -#include +#include #include #include #include #include +#include #include #include @@ -65,12 +66,13 @@ namespace xforms * * See http://www.w3.org/TR/xforms/ for more information. */ -typedef cppu::ImplInheritanceHelper4< +typedef cppu::ImplInheritanceHelper< PropertySetBase, com::sun::star::xforms::XModel2, com::sun::star::xforms::XFormsUIHelper1, com::sun::star::util::XUpdatable, - com::sun::star::lang::XUnoTunnel + com::sun::star::lang::XUnoTunnel, + css::lang::XServiceInfo > Model_t; class Model : public Model_t { @@ -439,6 +441,14 @@ public: virtual IntSequence_t SAL_CALL getImplementationId() throw( RuntimeException_t ) SAL_OVERRIDE; + OUString SAL_CALL getImplementationName() + throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE; + + sal_Bool SAL_CALL supportsService(OUString const & ServiceName) + throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE; + + css::uno::Sequence SAL_CALL getSupportedServiceNames() + throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE; }; } // namespace diff --git a/forms/source/xforms/xforms_services.cxx b/forms/source/xforms/xforms_services.cxx index 9637ae1ae97c..7e88ab115db5 100644 --- a/forms/source/xforms/xforms_services.cxx +++ b/forms/source/xforms/xforms_services.cxx @@ -24,14 +24,39 @@ #include #include #include +#include using namespace ::com::sun::star; +namespace { + +class Implementation: + public cppu::ImplInheritanceHelper< + NameContainer>, + css::lang::XServiceInfo> +{ + OUString SAL_CALL getImplementationName() + throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE + { return OUString("com.sun.star.form.XForms"); } + + sal_Bool SAL_CALL supportsService(OUString const & ServiceName) + throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE + { return cppu::supportsService(this, ServiceName); } + + css::uno::Sequence SAL_CALL getSupportedServiceNames() + throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE + { + return css::uno::Sequence{"com.sun.star.xforms.XForms"}; + } +}; + +} + extern "C" SAL_DLLPUBLIC_EXPORT uno::XInterface* SAL_CALL com_sun_star_form_XForms_get_implementation(uno::XComponentContext*, uno::Sequence const &) { - return cppu::acquire(new NameContainer >()); + return cppu::acquire(new Implementation); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit v1.2.3