20#include <com/sun/star/ucb/XAnyCompareFactory.hpp>
21#include <com/sun/star/i18n/Collator.hpp>
22#include <com/sun/star/lang/Locale.hpp>
23#include <com/sun/star/uno/Sequence.h>
26#include <com/sun/star/lang/XServiceInfo.hpp>
27#include <com/sun/star/lang/XInitialization.hpp>
36class AnyCompare :
public ::cppu::WeakImplHelper< XAnyCompare >
42 : m_xCollator(Collator::
create( xContext ))
44 m_xCollator->loadDefaultCollator( rLocale,
48 virtual sal_Int16 SAL_CALL
compare(
const Any& any1,
const Any& any2 )
override;
51class AnyCompareFactory :
public cppu::WeakImplHelper< XAnyCompareFactory, XInitialization, XServiceInfo >
65 virtual void SAL_CALL initialize(
const Sequence< Any >& aArguments )
override;
75sal_Int16 SAL_CALL AnyCompare::compare(
const Any& any1,
const Any& any2 )
77 sal_Int16 aResult = 0;
85 aResult =
static_cast<sal_Int16
>(m_xCollator->compareString(aStr1, aStr2));
95 if( aPropertyName ==
"Title" )
101void SAL_CALL AnyCompareFactory::initialize(
const Sequence< Any >& aArguments )
105 if( aArguments[0] >>= m_Locale )
107 m_xAnyCompare =
new AnyCompare( m_xContext, m_Locale );
113OUString SAL_CALL AnyCompareFactory::getImplementationName( )
115 return "AnyCompareFactory";
118sal_Bool SAL_CALL AnyCompareFactory::supportsService(
const OUString& ServiceName )
125 return {
"com.sun.star.ucb.AnyCompareFactory" };
128extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
130 css::uno::XComponentContext *context,
131 css::uno::Sequence<css::uno::Any>
const &)
133 return cppu::acquire(
new AnyCompareFactory(context));
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * AnyCompareFactory_get_implementation(css::uno::XComponentContext *context, css::uno::Sequence< css::uno::Any > const &)
Reference< XComponentContext > m_xContext
Sequence< PropertyValue > aArguments
css::uno::Sequence< OUString > getSupportedServiceNames()
OUString getImplementationName()
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
css::uno::Reference< css::deployment::XPackageRegistry > create(css::uno::Reference< css::deployment::XPackageRegistry > const &xRootRegistry, OUString const &context, OUString const &cachePath, css::uno::Reference< css::uno::XComponentContext > const &xComponentContext)
SbxDecimal::CmpResult compare(SAL_UNUSED_PARAMETER const SbxDecimal &, SAL_UNUSED_PARAMETER const SbxDecimal &)