tdf#74608 comphelper: Constructor feature for IndexedPropertyValuesContainer

Change-Id: I0e9ea9e4c750918b33040dad2279fe55facd4cab
Reviewed-on: https://gerrit.libreoffice.org/21858
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Matúš Kukan <matus@libreoffice.org>
diff --git a/comphelper/source/container/IndexedPropertyValuesContainer.cxx b/comphelper/source/container/IndexedPropertyValuesContainer.cxx
index 2ab5572..914629a 100644
--- a/comphelper/source/container/IndexedPropertyValuesContainer.cxx
+++ b/comphelper/source/container/IndexedPropertyValuesContainer.cxx
@@ -17,11 +17,9 @@
 *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
 */

#include "comphelper_module.hxx"
#include "comphelper_services.hxx"

#include <com/sun/star/container/XIndexContainer.hpp>
#include <com/sun/star/uno/Sequence.h>
#include <com/sun/star/uno/XComponentContext.hpp>
#include <com/sun/star/beans/PropertyValue.hpp>
#include <cppuhelper/implbase.hxx>
#include <com/sun/star/lang/XServiceInfo.hpp>
@@ -70,11 +68,6 @@ public:
    virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw(css::uno::RuntimeException, std::exception) override;
    virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames(  ) throw(css::uno::RuntimeException, std::exception) override;

    // XServiceInfo - static versions (used for component registration)
    static OUString SAL_CALL getImplementationName_static();
    static uno::Sequence< OUString > SAL_CALL getSupportedServiceNames_static();
    static uno::Reference< uno::XInterface > SAL_CALL Create( const uno::Reference< uno::XComponentContext >& );

private:
    IndexedPropertyValues maProperties;
};
@@ -217,11 +210,6 @@ sal_Bool SAL_CALL IndexedPropertyValuesContainer::hasElements(  )
//XServiceInfo
OUString SAL_CALL IndexedPropertyValuesContainer::getImplementationName(  ) throw(css::uno::RuntimeException, std::exception)
{
    return getImplementationName_static();
}

OUString SAL_CALL IndexedPropertyValuesContainer::getImplementationName_static(  )
{
    return OUString( "IndexedPropertyValuesContainer" );
}

@@ -232,27 +220,17 @@ sal_Bool SAL_CALL IndexedPropertyValuesContainer::supportsService( const OUStrin

css::uno::Sequence< OUString > SAL_CALL IndexedPropertyValuesContainer::getSupportedServiceNames(  ) throw(css::uno::RuntimeException, std::exception)
{
    return getSupportedServiceNames_static();
}


css::uno::Sequence< OUString > SAL_CALL IndexedPropertyValuesContainer::getSupportedServiceNames_static(  )
{
    const OUString aServiceName( "com.sun.star.document.IndexedPropertyValues" );
    const uno::Sequence< OUString > aSeq( &aServiceName, 1 );
    return aSeq;
}


uno::Reference< uno::XInterface > SAL_CALL IndexedPropertyValuesContainer::Create(
                SAL_UNUSED_PARAMETER const uno::Reference< uno::XComponentContext >&)
extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
IndexedPropertyValuesContainer_get_implementation(
    css::uno::XComponentContext *,
    css::uno::Sequence<css::uno::Any> const &)
{
    return static_cast<cppu::OWeakObject*>(new IndexedPropertyValuesContainer());
}

void createRegistryInfo_IndexedPropertyValuesContainer()
{
    static ::comphelper::module::OAutoRegistration< IndexedPropertyValuesContainer > aAutoRegistration;
    return cppu::acquire(new IndexedPropertyValuesContainer());
}

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/comphelper/source/inc/comphelper_services.hxx b/comphelper/source/inc/comphelper_services.hxx
index d62a16a..602ac7a 100644
--- a/comphelper/source/inc/comphelper_services.hxx
+++ b/comphelper/source/inc/comphelper_services.hxx
@@ -23,7 +23,6 @@
#include <sal/config.h>

void createRegistryInfo_AnyCompareFactory();
void createRegistryInfo_IndexedPropertyValuesContainer();
void createRegistryInfo_Map();
void createRegistryInfo_NamedPropertyValuesContainer();
void createRegistryInfo_OInstanceLocker();
diff --git a/comphelper/source/misc/comphelper_services.cxx b/comphelper/source/misc/comphelper_services.cxx
index 979cd36..fe534b7 100644
--- a/comphelper/source/misc/comphelper_services.cxx
+++ b/comphelper/source/misc/comphelper_services.cxx
@@ -38,7 +38,6 @@ namespace comphelper { namespace module
                createRegistryInfo_SequenceOutputStream();
                createRegistryInfo_SequenceInputStream();
                createRegistryInfo_UNOMemoryStream();
                createRegistryInfo_IndexedPropertyValuesContainer();
                createRegistryInfo_NamedPropertyValuesContainer();
                createRegistryInfo_AnyCompareFactory();
                createRegistryInfo_OInstanceLocker();
diff --git a/comphelper/util/comphelp.component b/comphelper/util/comphelp.component
index 3a6803f..f7b7d9a 100644
--- a/comphelper/util/comphelp.component
+++ b/comphelper/util/comphelp.component
@@ -22,7 +22,8 @@
  <implementation name="AnyCompareFactory">
    <service name="com.sun.star.ucb.AnyCompareFactory"/>
  </implementation>
  <implementation name="IndexedPropertyValuesContainer">
  <implementation name="IndexedPropertyValuesContainer"
      constructor="IndexedPropertyValuesContainer_get_implementation">
    <service name="com.sun.star.document.IndexedPropertyValues"/>
  </implementation>
  <implementation name="NamedPropertyValuesContainer">