tdf#74608 comphelper: Constructor feature for AnyCompareFactory

Change-Id: If5d35828a7309b6916de65282e32ce1ad459a15f
Reviewed-on: https://gerrit.libreoffice.org/21936
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
This commit is contained in:
kripton 2016-01-30 17:52:26 +02:00 committed by Stephan Bergmann
parent ee5b0e6c97
commit a395a1137d
4 changed files with 8 additions and 29 deletions

View File

@ -17,13 +17,11 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include "comphelper_module.hxx"
#include "comphelper_services.hxx"
#include <com/sun/star/ucb/XAnyCompareFactory.hpp>
#include <com/sun/star/i18n/Collator.hpp>
#include <com/sun/star/lang/Locale.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 <cppuhelper/supportsservice.hxx>
@ -74,11 +72,6 @@ public:
virtual OUString SAL_CALL getImplementationName( ) throw(RuntimeException, std::exception) override;
virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw(RuntimeException, std::exception) override;
virtual Sequence< OUString > SAL_CALL getSupportedServiceNames( ) throw(RuntimeException, std::exception) override;
// XServiceInfo - static versions (used for component registration)
static OUString SAL_CALL getImplementationName_static();
static Sequence< OUString > SAL_CALL getSupportedServiceNames_static();
static Reference< XInterface > SAL_CALL Create( const Reference< XComponentContext >& );
};
sal_Int16 SAL_CALL AnyCompare::compare( const Any& any1, const Any& any2 ) throw(css::uno::RuntimeException, std::exception)
@ -120,11 +113,6 @@ void SAL_CALL AnyCompareFactory::initialize( const Sequence< Any >& aArguments )
}
OUString SAL_CALL AnyCompareFactory::getImplementationName( ) throw( RuntimeException, std::exception )
{
return getImplementationName_static();
}
OUString SAL_CALL AnyCompareFactory::getImplementationName_static( )
{
return OUString( "AnyCompareFactory" );
}
@ -135,26 +123,18 @@ sal_Bool SAL_CALL AnyCompareFactory::supportsService( const OUString& ServiceNam
}
Sequence< OUString > SAL_CALL AnyCompareFactory::getSupportedServiceNames( ) throw(RuntimeException, std::exception)
{
return getSupportedServiceNames_static();
}
Sequence< OUString > SAL_CALL AnyCompareFactory::getSupportedServiceNames_static( )
{
const OUString aServiceName( "com.sun.star.ucb.AnyCompareFactory" );
const Sequence< OUString > aSeq( &aServiceName, 1 );
return aSeq;
}
Reference< XInterface > SAL_CALL AnyCompareFactory::Create(
const Reference< XComponentContext >& rxContext )
extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
AnyCompareFactory_get_implementation(
css::uno::XComponentContext *context,
css::uno::Sequence<css::uno::Any> const &)
{
return static_cast<cppu::OWeakObject*>(new AnyCompareFactory( rxContext ));
}
void createRegistryInfo_AnyCompareFactory()
{
static ::comphelper::module::OAutoRegistration< AnyCompareFactory > aAutoRegistration;
return cppu::acquire(new AnyCompareFactory(context));
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@ -22,7 +22,6 @@
#include <sal/config.h>
void createRegistryInfo_AnyCompareFactory();
void createRegistryInfo_Map();
void createRegistryInfo_OInstanceLocker();
void createRegistryInfo_OPropertyBag();

View File

@ -38,7 +38,6 @@ namespace comphelper { namespace module
createRegistryInfo_SequenceOutputStream();
createRegistryInfo_SequenceInputStream();
createRegistryInfo_UNOMemoryStream();
createRegistryInfo_AnyCompareFactory();
createRegistryInfo_OInstanceLocker();
createRegistryInfo_Map();
createRegistryInfo_OSimpleLogRing();

View File

@ -19,7 +19,8 @@
<component loader="com.sun.star.loader.SharedLibrary" environment="@CPPU_ENV@"
prefix="comphelp" xmlns="http://openoffice.org/2010/uno-components">
<implementation name="AnyCompareFactory">
<implementation name="AnyCompareFactory"
constructor="AnyCompareFactory_get_implementation">
<service name="com.sun.star.ucb.AnyCompareFactory"/>
</implementation>
<implementation name="IndexedPropertyValuesContainer"