[Libreoffice-commits] core.git: Branch 'distro/collabora/viewer' - 3 commits - solenv/bin stoc/inc stoc/Library_bootstrap.mk stoc/Library_stocservices.mk stoc/source stoc/util

Jan Holesovsky kendy at collabora.com
Sat Feb 21 14:00:23 PST 2015


 solenv/bin/native-code.py                                         |    8 
 stoc/Library_bootstrap.mk                                         |    5 
 stoc/Library_stocservices.mk                                      |    6 
 stoc/inc/stocservices.hxx                                         |   85 ----------
 stoc/source/stocservices/stocservices.cxx                         |   82 ---------
 stoc/source/typeconv/convert.cxx                                  |   39 +---
 stoc/source/uriproc/ExternalUriReferenceTranslator.cxx            |   32 ---
 stoc/source/uriproc/UriReferenceFactory.cxx                       |   28 ---
 stoc/source/uriproc/UriSchemeParser_vndDOTsunDOTstarDOTexpand.cxx |   33 ---
 stoc/source/uriproc/UriSchemeParser_vndDOTsunDOTstarDOTscript.cxx |   34 ----
 stoc/source/uriproc/VndSunStarPkgUrlReferenceFactory.cxx          |   34 ----
 stoc/util/stocservices.component                                  |   23 +-
 12 files changed, 69 insertions(+), 340 deletions(-)

New commits:
commit d5a3ca81900d6d7145ef6aa8af3eb24b3ca1c750
Author: Jan Holesovsky <kendy at collabora.com>
Date:   Sat Feb 21 22:52:01 2015 +0100

    native-code.py: Missing services after the stocservices conversion.
    
    Change-Id: I70bb9386487930061c6bb1576de29d4bdcc56f8c

diff --git a/solenv/bin/native-code.py b/solenv/bin/native-code.py
index a316e40..47c63bd 100755
--- a/solenv/bin/native-code.py
+++ b/solenv/bin/native-code.py
@@ -24,7 +24,6 @@ core_factory_list = [
     ("libembobj.a", "embobj_component_getFactory"),
     ("libevtattlo.a", "evtatt_component_getFactory"),
     ("libreflectionlo.a", "reflection_component_getFactory"),
-    ("libstocserviceslo.a", "stocservices_component_getFactory"),
     ("libcomphelper.a", "comphelp_component_getFactory"),
     ("libconfigmgrlo.a", "configmgr_component_getFactory"),
     ("libdrawinglayerlo.a", "drawinglayer_component_getFactory"),
@@ -90,6 +89,7 @@ core_constructor_list = [
 # dbaccess/util/dba.component
     "com_sun_star_comp_dba_ORowSet_get_implementation",
 # forms/util/frm.component
+    "com_sun_star_comp_forms_FormOperations_get_implementation",
     "com_sun_star_form_OCheckBoxControl_get_implementation",
     "com_sun_star_form_OCheckBoxModel_get_implementation",
     "com_sun_star_form_OComboBoxControl_get_implementation",
@@ -137,8 +137,14 @@ core_constructor_list = [
 # sfx2/util/sfx.component
     "SfxDocumentMetaData_get_implementation",
     "com_sun_star_comp_office_FrameLoader_get_implementation",
+    "com_sun_star_comp_sfx2_AppDispatchProvider_get_implementation",
     "com_sun_star_comp_sfx2_DocumentTemplates_get_implementation",
     "com_sun_star_comp_sfx2_GlobalEventBroadcaster_get_implementation",
+# stoc/util/stocservices.component
+    "com_sun_star_comp_stoc_TypeConverter_get_implementation",
+    "com_sun_star_comp_uri_ExternalUriReferenceTranslator_get_implementation",
+    "com_sun_star_comp_uri_UriReferenceFactory_get_implementation",
+    "com_sun_star_comp_uri_UriSchemeParser_vndDOTsunDOTstarDOTexpand_get_implementation",
 # svtools/util/svt.component
     "com_sun_star_graphic_GraphicObject_get_implementation",
     "com_sun_star_comp_graphic_GraphicProvider_get_implementation",
commit e7394e5fd6a37ceab178a7969ca7ad8fe97cce8f
Author: Jan Holesovsky <kendy at collabora.com>
Date:   Thu Feb 19 21:21:41 2015 +0100

    stocservices.component: The rest of the services + cleanup.
    
    Change-Id: I5156318afde0f56cf3eb8d1c74c6db8d5e378600

diff --git a/stoc/Library_bootstrap.mk b/stoc/Library_bootstrap.mk
index 6c68a7f..1080cc95 100644
--- a/stoc/Library_bootstrap.mk
+++ b/stoc/Library_bootstrap.mk
@@ -19,11 +19,6 @@ $(eval $(call gb_Library_add_defs,bootstrap,\
 
 endif
 
-$(eval $(call gb_Library_set_include,bootstrap,\
-    -I$(SRCDIR)/stoc/inc \
-    $$(INCLUDE) \
-))
-
 $(eval $(call gb_Library_use_external,bootstrap,boost_headers))
 
 $(eval $(call gb_Library_use_internal_bootstrap_api,bootstrap,\
diff --git a/stoc/Library_stocservices.mk b/stoc/Library_stocservices.mk
index 3c5dc90..aa71d9e 100644
--- a/stoc/Library_stocservices.mk
+++ b/stoc/Library_stocservices.mk
@@ -9,11 +9,6 @@
 
 $(eval $(call gb_Library_Library,stocservices))
 
-$(eval $(call gb_Library_set_include,stocservices,\
-    -I$(SRCDIR)/stoc/inc \
-    $$(INCLUDE) \
-))
-
 $(eval $(call gb_Library_use_udk_api,stocservices))
 
 $(eval $(call gb_Library_use_libraries,stocservices,\
@@ -28,7 +23,6 @@ $(eval $(call gb_Library_use_external,stocservices,boost_headers))
 $(eval $(call gb_Library_set_componentfile,stocservices,stoc/util/stocservices))
 
 $(eval $(call gb_Library_add_exception_objects,stocservices,\
-    stoc/source/stocservices/stocservices \
     stoc/source/typeconv/convert \
     stoc/source/uriproc/ExternalUriReferenceTranslator \
     stoc/source/uriproc/UriReference \
diff --git a/stoc/inc/stocservices.hxx b/stoc/inc/stocservices.hxx
deleted file mode 100644
index e79e551..0000000
--- a/stoc/inc/stocservices.hxx
+++ /dev/null
@@ -1,85 +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 .
- */
-
-#ifndef INCLUDED_STOC_INC_STOCSERVICES_HXX
-#define INCLUDED_STOC_INC_STOCSERVICES_HXX
-
-#include <rtl/ustring.hxx>
-#include <com/sun/star/uno/Sequence.hxx>
-#include <com/sun/star/uno/Reference.hxx>
-#include <com/sun/star/uno/RuntimeException.hpp>
-
-namespace com { namespace sun { namespace star { namespace uno {
-    class XInterface;
-    class XComponentContext;
-} } } }
-
-namespace stoc_services
-{
-    // typeconv
-    css::uno::Reference< css::uno::XInterface > SAL_CALL TypeConverter_Impl_CreateInstance(
-        const css::uno::Reference< css::uno::XComponentContext > & )
-    throw( css::uno::RuntimeException );
-    css::uno::Sequence< OUString > tcv_getSupportedServiceNames();
-    OUString tcv_getImplementationName();
-
-    namespace ExternalUriReferenceTranslator
-    {
-    css::uno::Reference< css::uno::XInterface > SAL_CALL create(
-        css::uno::Reference< css::uno::XComponentContext > const & context);
-    OUString SAL_CALL getImplementationName();
-    css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames();
-    }
-
-    namespace UriReferenceFactory
-    {
-    css::uno::Reference< css::uno::XInterface > SAL_CALL create(
-        css::uno::Reference< css::uno::XComponentContext >  const & context);
-    OUString SAL_CALL getImplementationName();
-    css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames();
-    }
-
-    namespace UriSchemeParser_vndDOTsunDOTstarDOTexpand
-    {
-    css::uno::Reference< css::uno::XInterface > SAL_CALL create(
-        css::uno::Reference< css::uno::XComponentContext > const &);
-    OUString SAL_CALL getImplementationName();
-    css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames();
-    }
-
-    namespace UriSchemeParser_vndDOTsunDOTstarDOTscript
-    {
-    css::uno::Reference< css::uno::XInterface > SAL_CALL create(
-        css::uno::Reference< css::uno::XComponentContext > const &);
-    OUString SAL_CALL getImplementationName();
-    css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames();
-    }
-
-    namespace VndSunStarPkgUrlReferenceFactory
-    {
-    css::uno::Reference< css::uno::XInterface > SAL_CALL create(
-        css::uno::Reference< css::uno::XComponentContext > const & context);
-    OUString SAL_CALL getImplementationName();
-    css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames();
-    }
-} // namespace
-
-#endif // INCLUDED_STOC_INC_STOCSERVICES_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/stoc/source/stocservices/stocservices.cxx b/stoc/source/stocservices/stocservices.cxx
deleted file mode 100644
index 347580c..0000000
--- a/stoc/source/stocservices/stocservices.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 "stocservices.hxx"
-
-#include <cppuhelper/factory.hxx>
-#include <cppuhelper/implementationentry.hxx>
-#include <sal/types.h>
-#include <uno/environment.h>
-
-using namespace com::sun::star;
-using namespace css::uno;
-using namespace cppu;
-using namespace osl;
-using namespace stoc_services;
-
-static const struct ImplementationEntry g_entries[] =
-{
-    // typeconv
-    {
-    TypeConverter_Impl_CreateInstance, tcv_getImplementationName,
-    tcv_getSupportedServiceNames, createSingleComponentFactory,
-    0, 0
-    },
-    {
-    UriSchemeParser_vndDOTsunDOTstarDOTexpand::create,
-    UriSchemeParser_vndDOTsunDOTstarDOTexpand::getImplementationName,
-    UriSchemeParser_vndDOTsunDOTstarDOTexpand::getSupportedServiceNames,
-    createSingleComponentFactory, 0, 0
-    },
-    {
-    UriSchemeParser_vndDOTsunDOTstarDOTscript::create,
-    UriSchemeParser_vndDOTsunDOTstarDOTscript::getImplementationName,
-    UriSchemeParser_vndDOTsunDOTstarDOTscript::getSupportedServiceNames,
-    createSingleComponentFactory, 0, 0
-    },
-    { 0, 0, 0, 0, 0, 0 }
-};
-
-extern "C" SAL_DLLPUBLIC_EXPORT void * SAL_CALL stocservices_component_getFactory(
-    const sal_Char * pImplName, void * pServiceManager, void * pRegistryKey )
-{
-    return component_getFactoryHelper( pImplName, pServiceManager, pRegistryKey , g_entries );
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/stoc/source/typeconv/convert.cxx b/stoc/source/typeconv/convert.cxx
index 182c030..e8cd37c 100644
--- a/stoc/source/typeconv/convert.cxx
+++ b/stoc/source/typeconv/convert.cxx
@@ -42,8 +42,6 @@
 #include <com/sun/star/registry/XRegistryKey.hpp>
 #include <com/sun/star/uno/XComponentContext.hpp>
 
-#include <stocservices.hxx>
-
 using namespace css::uno;
 using namespace css::lang;
 using namespace css::script;
@@ -51,23 +49,6 @@ using namespace css::registry;
 using namespace cppu;
 using namespace osl;
 
-#define IMPLNAME    "com.sun.star.comp.stoc.TypeConverter"
-
-namespace stoc_services
-{
-Sequence< OUString > tcv_getSupportedServiceNames()
-{
-    Sequence< OUString > seqNames(1);
-    seqNames.getArray()[0] = "com.sun.star.script.Converter";
-    return seqNames;
-}
-
-OUString tcv_getImplementationName()
-{
-    return OUString(IMPLNAME);
-}
-}
-
 namespace stoc_tcv
 {
 
@@ -290,7 +271,7 @@ TypeConverter_Impl::~TypeConverter_Impl() {}
 // XServiceInfo
 OUString TypeConverter_Impl::getImplementationName() throw( RuntimeException, std::exception )
 {
-    return stoc_services::tcv_getImplementationName();
+    return OUString("com.sun.star.comp.stoc.TypeConverter");
 }
 
 // XServiceInfo
@@ -302,7 +283,9 @@ sal_Bool TypeConverter_Impl::supportsService(const OUString& ServiceName) throw(
 // XServiceInfo
 Sequence< OUString > TypeConverter_Impl::getSupportedServiceNames(void) throw( RuntimeException, std::exception )
 {
-    return stoc_services::tcv_getSupportedServiceNames();
+    Sequence< OUString > seqNames(1);
+    seqNames.getArray()[0] = "com.sun.star.script.Converter";
+    return seqNames;
 }
 
 
@@ -908,18 +891,14 @@ Any TypeConverter_Impl::convertToSimpleType( const Any& rVal, TypeClass aDestina
         "conversion not possible!",
         Reference< XInterface >(), aDestinationClass, FailReason::INVALID, 0 );
 }
-}
 
-namespace stoc_services
-{
+}
 
-Reference< XInterface > SAL_CALL TypeConverter_Impl_CreateInstance(
-    SAL_UNUSED_PARAMETER const Reference< XComponentContext > & )
-    throw( RuntimeException )
+extern "C" SAL_DLLPUBLIC_EXPORT ::com::sun::star::uno::XInterface* SAL_CALL
+com_sun_star_comp_stoc_TypeConverter_get_implementation(::com::sun::star::uno::XComponentContext*,
+        ::com::sun::star::uno::Sequence<css::uno::Any> const &)
 {
-    static Reference< XInterface > s_ref( (OWeakObject *) new stoc_tcv::TypeConverter_Impl() );
-    return s_ref;
-}
+    return ::cppu::acquire(new stoc_tcv::TypeConverter_Impl());
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/stoc/source/uriproc/ExternalUriReferenceTranslator.cxx b/stoc/source/uriproc/ExternalUriReferenceTranslator.cxx
index fba94d2..c84cacb 100644
--- a/stoc/source/uriproc/ExternalUriReferenceTranslator.cxx
+++ b/stoc/source/uriproc/ExternalUriReferenceTranslator.cxx
@@ -17,9 +17,6 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-
-#include "stocservices.hxx"
-
 #include <boost/noncopyable.hpp>
 #include <com/sun/star/lang/XServiceInfo.hpp>
 #include <com/sun/star/uno/Exception.hpp>
@@ -79,8 +76,7 @@ private:
 OUString Translator::getImplementationName()
     throw (css::uno::RuntimeException, std::exception)
 {
-    return
-        stoc_services::ExternalUriReferenceTranslator::getImplementationName();
+    return OUString("com.sun.star.comp.uri.ExternalUriReferenceTranslator");
 }
 
 sal_Bool Translator::supportsService(OUString const & serviceName)
@@ -92,8 +88,9 @@ sal_Bool Translator::supportsService(OUString const & serviceName)
 css::uno::Sequence< OUString > Translator::getSupportedServiceNames()
     throw (css::uno::RuntimeException, std::exception)
 {
-    return stoc_services::ExternalUriReferenceTranslator::
-        getSupportedServiceNames();
+    css::uno::Sequence< OUString > s(1);
+    s[0] = "com.sun.star.uri.ExternalUriReferenceTranslator";
+    return s;
 }
 
 OUString Translator::translateToInternal(
@@ -193,26 +190,6 @@ OUString Translator::translateToExternal(
 
 }
 
-namespace stoc_services  { namespace ExternalUriReferenceTranslator {
-
-css::uno::Reference< css::uno::XInterface > create(
-    css::uno::Reference< css::uno::XComponentContext > const & context)
-{
-    return static_cast< cppu::OWeakObject * >(new Translator(context));
-}
-
-OUString getImplementationName() {
-    return OUString("com.sun.star.comp.uri.ExternalUriReferenceTranslator");
-}
-
-css::uno::Sequence< OUString > getSupportedServiceNames() {
-    css::uno::Sequence< OUString > s(1);
-    s[0] = "com.sun.star.uri.ExternalUriReferenceTranslator";
-    return s;
-}
-
-} }
-
 extern "C" SAL_DLLPUBLIC_EXPORT ::com::sun::star::uno::XInterface* SAL_CALL
 com_sun_star_comp_uri_ExternalUriReferenceTranslator_get_implementation(::com::sun::star::uno::XComponentContext* rxContext,
         ::com::sun::star::uno::Sequence<css::uno::Any> const &)
diff --git a/stoc/source/uriproc/UriReferenceFactory.cxx b/stoc/source/uriproc/UriReferenceFactory.cxx
index 08b967c..9ac0b4c 100644
--- a/stoc/source/uriproc/UriReferenceFactory.cxx
+++ b/stoc/source/uriproc/UriReferenceFactory.cxx
@@ -50,7 +50,6 @@
 #include <sal/types.h>
 
 #include "UriReference.hxx"
-#include "stocservices.hxx"
 
 namespace {
 
@@ -311,7 +310,7 @@ private:
 OUString Factory::getImplementationName()
     throw (css::uno::RuntimeException, std::exception)
 {
-    return stoc_services::UriReferenceFactory::getImplementationName();
+    return OUString("com.sun.star.comp.uri.UriReferenceFactory");
 }
 
 sal_Bool Factory::supportsService(OUString const & serviceName)
@@ -323,7 +322,9 @@ sal_Bool Factory::supportsService(OUString const & serviceName)
 css::uno::Sequence< OUString > Factory::getSupportedServiceNames()
     throw (css::uno::RuntimeException, std::exception)
 {
-    return stoc_services::UriReferenceFactory::getSupportedServiceNames();
+    css::uno::Sequence< OUString > s(1);
+    s[0] = "com.sun.star.uri.UriReferenceFactory";
+    return s;
 }
 
 css::uno::Reference< css::uri::XUriReference > Factory::parse(
@@ -632,26 +633,6 @@ css::uno::Reference< css::uri::XUriReference > Factory::makeRelative(
 
 }
 
-namespace stoc_services { namespace UriReferenceFactory {
-
-css::uno::Reference< css::uno::XInterface > create(
-    css::uno::Reference< css::uno::XComponentContext > const & context)
-{
-    return static_cast< cppu::OWeakObject * >(new Factory(context));
-}
-
-OUString getImplementationName() {
-    return OUString("com.sun.star.comp.uri.UriReferenceFactory");
-}
-
-css::uno::Sequence< OUString > getSupportedServiceNames() {
-    css::uno::Sequence< OUString > s(1);
-    s[0] = "com.sun.star.uri.UriReferenceFactory";
-    return s;
-}
-
-} }
-
 extern "C" SAL_DLLPUBLIC_EXPORT ::com::sun::star::uno::XInterface* SAL_CALL
 com_sun_star_comp_uri_UriReferenceFactory_get_implementation(::com::sun::star::uno::XComponentContext* rxContext,
         ::com::sun::star::uno::Sequence<css::uno::Any> const &)
diff --git a/stoc/source/uriproc/UriSchemeParser_vndDOTsunDOTstarDOTexpand.cxx b/stoc/source/uriproc/UriSchemeParser_vndDOTsunDOTstarDOTexpand.cxx
index 777651a..0157f78 100644
--- a/stoc/source/uriproc/UriSchemeParser_vndDOTsunDOTstarDOTexpand.cxx
+++ b/stoc/source/uriproc/UriSchemeParser_vndDOTsunDOTstarDOTexpand.cxx
@@ -19,8 +19,6 @@
 
 #include <sal/config.h>
 
-#include "stocservices.hxx"
-
 #include <exception>
 
 #include <boost/noncopyable.hpp>
@@ -184,8 +182,7 @@ private:
 OUString Parser::getImplementationName()
     throw (css::uno::RuntimeException, std::exception)
 {
-    return ::stoc_services::UriSchemeParser_vndDOTsunDOTstarDOTexpand::
-        getImplementationName();
+    return OUString("com.sun.star.comp.uri.UriSchemeParser_vndDOTsunDOTstarDOTexpand");
 }
 
 sal_Bool Parser::supportsService(OUString const & serviceName)
@@ -197,8 +194,9 @@ sal_Bool Parser::supportsService(OUString const & serviceName)
 css::uno::Sequence< OUString > Parser::getSupportedServiceNames()
     throw (css::uno::RuntimeException, std::exception)
 {
-    return ::stoc_services::UriSchemeParser_vndDOTsunDOTstarDOTexpand::
-        getSupportedServiceNames();
+    css::uno::Sequence< OUString > s(1);
+    s[0] = "com.sun.star.uri.UriSchemeParser_vndDOTsunDOTstarDOTexpand";
+    return s;
 }
 
 css::uno::Reference< css::uri::XUriReference > Parser::parse(
@@ -213,27 +211,12 @@ css::uno::Reference< css::uri::XUriReference > Parser::parse(
 
 }
 
-namespace stoc_services { namespace UriSchemeParser_vndDOTsunDOTstarDOTexpand {
-
-css::uno::Reference< css::uno::XInterface > create(
-    SAL_UNUSED_PARAMETER css::uno::Reference< css::uno::XComponentContext >
-        const &)
+extern "C" SAL_DLLPUBLIC_EXPORT ::com::sun::star::uno::XInterface* SAL_CALL
+com_sun_star_comp_uri_UriSchemeParser_vndDOTsunDOTstarDOTexpand_get_implementation(::com::sun::star::uno::XComponentContext*,
+        ::com::sun::star::uno::Sequence<css::uno::Any> const &)
 {
     //TODO: single instance
-    return static_cast< ::cppu::OWeakObject * >(new Parser);
-}
-
-OUString getImplementationName() {
-    return OUString(
-            "com.sun.star.comp.uri.UriSchemeParser_vndDOTsunDOTstarDOTexpand");
+    return ::cppu::acquire(new Parser());
 }
 
-css::uno::Sequence< OUString > getSupportedServiceNames() {
-    css::uno::Sequence< OUString > s(1);
-    s[0] = "com.sun.star.uri.UriSchemeParser_vndDOTsunDOTstarDOTexpand";
-    return s;
-}
-
-} }
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/stoc/source/uriproc/UriSchemeParser_vndDOTsunDOTstarDOTscript.cxx b/stoc/source/uriproc/UriSchemeParser_vndDOTsunDOTstarDOTscript.cxx
index 5866c31..631e6ef 100644
--- a/stoc/source/uriproc/UriSchemeParser_vndDOTsunDOTstarDOTscript.cxx
+++ b/stoc/source/uriproc/UriSchemeParser_vndDOTsunDOTstarDOTscript.cxx
@@ -17,9 +17,6 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-
-#include "stocservices.hxx"
-
 #include "UriReference.hxx"
 
 #include <boost/noncopyable.hpp>
@@ -405,8 +402,7 @@ private:
 OUString Parser::getImplementationName()
     throw (css::uno::RuntimeException, std::exception)
 {
-    return stoc_services::UriSchemeParser_vndDOTsunDOTstarDOTscript::
-        getImplementationName();
+    return OUString("com.sun.star.comp.uri.UriSchemeParser_vndDOTsunDOTstarDOTscript");
 }
 
 sal_Bool Parser::supportsService(OUString const & serviceName)
@@ -418,8 +414,9 @@ sal_Bool Parser::supportsService(OUString const & serviceName)
 css::uno::Sequence< OUString > Parser::getSupportedServiceNames()
     throw (css::uno::RuntimeException, std::exception)
 {
-    return stoc_services::UriSchemeParser_vndDOTsunDOTstarDOTscript::
-        getSupportedServiceNames();
+    css::uno::Sequence< OUString > s(1);
+    s[0] = "com.sun.star.uri.UriSchemeParser_vndDOTsunDOTstarDOTscript";
+    return s;
 }
 
 css::uno::Reference< css::uri::XUriReference >
@@ -435,27 +432,12 @@ Parser::parse(
 
 }
 
-namespace stoc_services {
-namespace UriSchemeParser_vndDOTsunDOTstarDOTscript {
-
-css::uno::Reference< css::uno::XInterface > create(
-    SAL_UNUSED_PARAMETER css::uno::Reference< css::uno::XComponentContext >
-        const &)
+extern "C" SAL_DLLPUBLIC_EXPORT ::com::sun::star::uno::XInterface* SAL_CALL
+com_sun_star_comp_uri_UriSchemeParser_vndDOTsunDOTstarDOTscript_get_implementation(::com::sun::star::uno::XComponentContext*,
+        ::com::sun::star::uno::Sequence<css::uno::Any> const &)
 {
     //TODO: single instance
-    return static_cast< cppu::OWeakObject * >(new Parser);
-}
-
-OUString getImplementationName() {
-    return OUString("com.sun.star.comp.uri.UriSchemeParser_vndDOTsunDOTstarDOTscript");
-}
-
-css::uno::Sequence< OUString > getSupportedServiceNames() {
-    css::uno::Sequence< OUString > s(1);
-    s[0] = "com.sun.star.uri.UriSchemeParser_vndDOTsunDOTstarDOTscript";
-    return s;
+    return ::cppu::acquire(new Parser());
 }
 
-} }
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/stoc/source/uriproc/VndSunStarPkgUrlReferenceFactory.cxx b/stoc/source/uriproc/VndSunStarPkgUrlReferenceFactory.cxx
index 0276942..7c37e9c 100644
--- a/stoc/source/uriproc/VndSunStarPkgUrlReferenceFactory.cxx
+++ b/stoc/source/uriproc/VndSunStarPkgUrlReferenceFactory.cxx
@@ -17,9 +17,6 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-
-#include "stocservices.hxx"
-
 #include <boost/noncopyable.hpp>
 #include <com/sun/star/lang/XServiceInfo.hpp>
 #include <com/sun/star/uno/Exception.hpp>
@@ -79,9 +76,7 @@ private:
 OUString Factory::getImplementationName()
     throw (css::uno::RuntimeException, std::exception)
 {
-    return
-        stoc_services::VndSunStarPkgUrlReferenceFactory::
-        getImplementationName();
+    return OUString("com.sun.star.comp.uri.VndSunStarPkgUrlReferenceFactory");
 }
 
 sal_Bool Factory::supportsService(OUString const & serviceName)
@@ -93,8 +88,9 @@ sal_Bool Factory::supportsService(OUString const & serviceName)
 css::uno::Sequence< OUString > Factory::getSupportedServiceNames()
     throw (css::uno::RuntimeException, std::exception)
 {
-    return stoc_services::VndSunStarPkgUrlReferenceFactory::
-        getSupportedServiceNames();
+    css::uno::Sequence< OUString > s(1);
+    s[0] = "com.sun.star.uri.VndSunStarPkgUrlReferenceFactory";
+    return s;
 }
 
 css::uno::Reference< css::uri::XUriReference >
@@ -122,27 +118,6 @@ Factory::createVndSunStarPkgUrlReference(
 
 }
 
-namespace stoc_services { namespace VndSunStarPkgUrlReferenceFactory
-{
-
-css::uno::Reference< css::uno::XInterface > create(
-    css::uno::Reference< css::uno::XComponentContext > const & context)
-{
-    return static_cast< cppu::OWeakObject * >(new Factory(context));
-}
-
-OUString getImplementationName() {
-    return OUString("com.sun.star.comp.uri.VndSunStarPkgUrlReferenceFactory");
-}
-
-css::uno::Sequence< OUString > getSupportedServiceNames() {
-    css::uno::Sequence< OUString > s(1);
-    s[0] = "com.sun.star.uri.VndSunStarPkgUrlReferenceFactory";
-    return s;
-}
-
-} }
-
 extern "C" SAL_DLLPUBLIC_EXPORT ::com::sun::star::uno::XInterface* SAL_CALL
 com_sun_star_comp_uri_VndSunStarPkgUrlReferenceFactory_get_implementation(::com::sun::star::uno::XComponentContext* rxContext,
         ::com::sun::star::uno::Sequence<css::uno::Any> const &)
diff --git a/stoc/util/stocservices.component b/stoc/util/stocservices.component
index 982556e..bbb113f 100644
--- a/stoc/util/stocservices.component
+++ b/stoc/util/stocservices.component
@@ -17,9 +17,9 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  -->
 
-<component loader="com.sun.star.loader.SharedLibrary" environment="@CPPU_ENV@"
-    prefix="stocservices" xmlns="http://openoffice.org/2010/uno-components">
-  <implementation name="com.sun.star.comp.stoc.TypeConverter">
+<component loader="com.sun.star.loader.SharedLibrary" environment="@CPPU_ENV@" xmlns="http://openoffice.org/2010/uno-components">
+  <implementation name="com.sun.star.comp.stoc.TypeConverter"
+    constructor="com_sun_star_comp_stoc_TypeConverter_get_implementation">
     <service name="com.sun.star.script.Converter"/>
   </implementation>
   <implementation name="com.sun.star.comp.uri.ExternalUriReferenceTranslator"
@@ -30,12 +30,12 @@
     constructor="com_sun_star_comp_uri_UriReferenceFactory_get_implementation">
     <service name="com.sun.star.uri.UriReferenceFactory"/>
   </implementation>
-  <implementation
-       name="com.sun.star.comp.uri.UriSchemeParser_vndDOTsunDOTstarDOTexpand">
+  <implementation name="com.sun.star.comp.uri.UriSchemeParser_vndDOTsunDOTstarDOTexpand"
+    constructor="com_sun_star_comp_uri_UriSchemeParser_vndDOTsunDOTstarDOTexpand_get_implementation">
     <service name="com.sun.star.uri.UriSchemeParser_vndDOTsunDOTstarDOTexpand"/>
   </implementation>
-  <implementation
-       name="com.sun.star.comp.uri.UriSchemeParser_vndDOTsunDOTstarDOTscript">
+  <implementation name="com.sun.star.comp.uri.UriSchemeParser_vndDOTsunDOTstarDOTscript"
+    constructor="com_sun_star_comp_uri_UriSchemeParser_vndDOTsunDOTstarDOTscript_get_implementation">
     <service name="com.sun.star.uri.UriSchemeParser_vndDOTsunDOTstarDOTscript"/>
   </implementation>
   <implementation name="com.sun.star.comp.uri.VndSunStarPkgUrlReferenceFactory"
commit 7ac3834c0e0e740020d0a85e8ab8a5a0fdac5a91
Author: Ursache Vladimir <ursache at collabora.co.uk>
Date:   Thu Feb 19 01:17:31 2015 +0200

    stocservices.component partly refactored to use the "constructor" feature.
    
    Change-Id: I4c1c5e62de608738a91be4a234d9c160a18cbf8f

diff --git a/stoc/source/stocservices/stocservices.cxx b/stoc/source/stocservices/stocservices.cxx
index c8aa9d9..347580c 100644
--- a/stoc/source/stocservices/stocservices.cxx
+++ b/stoc/source/stocservices/stocservices.cxx
@@ -39,19 +39,6 @@ static const struct ImplementationEntry g_entries[] =
     tcv_getSupportedServiceNames, createSingleComponentFactory,
     0, 0
     },
-    // uriproc
-    {
-    ExternalUriReferenceTranslator::create,
-    ExternalUriReferenceTranslator::getImplementationName,
-    ExternalUriReferenceTranslator::getSupportedServiceNames,
-    createSingleComponentFactory, 0, 0
-    },
-    {
-    UriReferenceFactory::create,
-    UriReferenceFactory::getImplementationName,
-    UriReferenceFactory::getSupportedServiceNames,
-    createSingleComponentFactory, 0, 0
-    },
     {
     UriSchemeParser_vndDOTsunDOTstarDOTexpand::create,
     UriSchemeParser_vndDOTsunDOTstarDOTexpand::getImplementationName,
@@ -64,12 +51,6 @@ static const struct ImplementationEntry g_entries[] =
     UriSchemeParser_vndDOTsunDOTstarDOTscript::getSupportedServiceNames,
     createSingleComponentFactory, 0, 0
     },
-    {
-    VndSunStarPkgUrlReferenceFactory::create,
-    VndSunStarPkgUrlReferenceFactory::getImplementationName,
-    VndSunStarPkgUrlReferenceFactory::getSupportedServiceNames,
-    createSingleComponentFactory, 0, 0
-    },
     { 0, 0, 0, 0, 0, 0 }
 };
 
diff --git a/stoc/source/uriproc/ExternalUriReferenceTranslator.cxx b/stoc/source/uriproc/ExternalUriReferenceTranslator.cxx
index 136eb15..fba94d2 100644
--- a/stoc/source/uriproc/ExternalUriReferenceTranslator.cxx
+++ b/stoc/source/uriproc/ExternalUriReferenceTranslator.cxx
@@ -213,4 +213,11 @@ css::uno::Sequence< OUString > getSupportedServiceNames() {
 
 } }
 
+extern "C" SAL_DLLPUBLIC_EXPORT ::com::sun::star::uno::XInterface* SAL_CALL
+com_sun_star_comp_uri_ExternalUriReferenceTranslator_get_implementation(::com::sun::star::uno::XComponentContext* rxContext,
+        ::com::sun::star::uno::Sequence<css::uno::Any> const &)
+{
+    return ::cppu::acquire(new Translator(rxContext));
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/stoc/source/uriproc/UriReferenceFactory.cxx b/stoc/source/uriproc/UriReferenceFactory.cxx
index 393aa1a..08b967c 100644
--- a/stoc/source/uriproc/UriReferenceFactory.cxx
+++ b/stoc/source/uriproc/UriReferenceFactory.cxx
@@ -652,4 +652,11 @@ css::uno::Sequence< OUString > getSupportedServiceNames() {
 
 } }
 
+extern "C" SAL_DLLPUBLIC_EXPORT ::com::sun::star::uno::XInterface* SAL_CALL
+com_sun_star_comp_uri_UriReferenceFactory_get_implementation(::com::sun::star::uno::XComponentContext* rxContext,
+        ::com::sun::star::uno::Sequence<css::uno::Any> const &)
+{
+    return ::cppu::acquire(new Factory(rxContext));
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/stoc/source/uriproc/VndSunStarPkgUrlReferenceFactory.cxx b/stoc/source/uriproc/VndSunStarPkgUrlReferenceFactory.cxx
index 272c4a8..0276942 100644
--- a/stoc/source/uriproc/VndSunStarPkgUrlReferenceFactory.cxx
+++ b/stoc/source/uriproc/VndSunStarPkgUrlReferenceFactory.cxx
@@ -143,4 +143,11 @@ css::uno::Sequence< OUString > getSupportedServiceNames() {
 
 } }
 
+extern "C" SAL_DLLPUBLIC_EXPORT ::com::sun::star::uno::XInterface* SAL_CALL
+com_sun_star_comp_uri_VndSunStarPkgUrlReferenceFactory_get_implementation(::com::sun::star::uno::XComponentContext* rxContext,
+        ::com::sun::star::uno::Sequence<css::uno::Any> const &)
+{
+    return ::cppu::acquire(new Factory(rxContext));
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/stoc/util/stocservices.component b/stoc/util/stocservices.component
index d94f0ac..982556e 100644
--- a/stoc/util/stocservices.component
+++ b/stoc/util/stocservices.component
@@ -22,10 +22,12 @@
   <implementation name="com.sun.star.comp.stoc.TypeConverter">
     <service name="com.sun.star.script.Converter"/>
   </implementation>
-  <implementation name="com.sun.star.comp.uri.ExternalUriReferenceTranslator">
+  <implementation name="com.sun.star.comp.uri.ExternalUriReferenceTranslator"
+    constructor="com_sun_star_comp_uri_ExternalUriReferenceTranslator_get_implementation">
     <service name="com.sun.star.uri.ExternalUriReferenceTranslator"/>
   </implementation>
-  <implementation name="com.sun.star.comp.uri.UriReferenceFactory">
+  <implementation name="com.sun.star.comp.uri.UriReferenceFactory"
+    constructor="com_sun_star_comp_uri_UriReferenceFactory_get_implementation">
     <service name="com.sun.star.uri.UriReferenceFactory"/>
   </implementation>
   <implementation
@@ -36,7 +38,8 @@
        name="com.sun.star.comp.uri.UriSchemeParser_vndDOTsunDOTstarDOTscript">
     <service name="com.sun.star.uri.UriSchemeParser_vndDOTsunDOTstarDOTscript"/>
   </implementation>
-  <implementation name="com.sun.star.comp.uri.VndSunStarPkgUrlReferenceFactory">
+  <implementation name="com.sun.star.comp.uri.VndSunStarPkgUrlReferenceFactory"
+    constructor="com_sun_star_comp_uri_VndSunStarPkgUrlReferenceFactory_get_implementation">
     <service name="com.sun.star.uri.VndSunStarPkgUrlReferenceFactory"/>
   </implementation>
 </component>


More information about the Libreoffice-commits mailing list