diff options
author | Mikhail Voitenko <mav@openoffice.org> | 2002-01-14 08:44:33 +0000 |
---|---|---|
committer | Mikhail Voitenko <mav@openoffice.org> | 2002-01-14 08:44:33 +0000 |
commit | 9535720b83ee892c8c912f046678144c2aaf9c20 (patch) | |
tree | 3958556c211f4a0c788fc292b7f68ab8bbb36180 /comphelper/source/compare | |
parent | 9c809c80e43ebf80a1343f8cb3a4c0e6d98fa311 (diff) |
#95512# new AnyCompareFactory service implementation
Diffstat (limited to 'comphelper/source/compare')
-rw-r--r-- | comphelper/source/compare/AnyCompareFactory.cxx | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/comphelper/source/compare/AnyCompareFactory.cxx b/comphelper/source/compare/AnyCompareFactory.cxx index 8e1ca1a6a6c4..6461e7aa50d2 100644 --- a/comphelper/source/compare/AnyCompareFactory.cxx +++ b/comphelper/source/compare/AnyCompareFactory.cxx @@ -2,9 +2,9 @@ * * $RCSfile: AnyCompareFactory.cxx,v $ * - * $Revision: 1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: mav $ $Date: 2002-01-11 17:48:39 $ + * last change: $Author: mav $ $Date: 2002-01-14 09:44:33 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -87,6 +87,9 @@ #ifndef _COM_SUN_STAR_LANG_XINITIALIZATION_HPP_ #include <com/sun/star/lang/XInitialization.hpp> #endif +#ifndef _COM_SUN_STAR_LANG_ILLEGALARGUMENTEXCEPTION_HPP_ +#include <com/sun/star/lang/IllegalArgumentException.hpp> +#endif #ifndef _COMPHELPER_STLTYPES_HXX_ #include <comphelper/stl_types.hxx> #endif @@ -180,16 +183,26 @@ Reference< XAnyCompare > SAL_CALL AnyCompareFactory::createAnyCompareByName( con // for now only OUString properties compare is implemented // so no check for the property name is done - return m_rAnyCompare; + if( aPropertyName.equals( OUString::createFromAscii( "Title" ) ) ) + return m_rAnyCompare; + + return Reference< XAnyCompare >(); } void SAL_CALL AnyCompareFactory::initialize( const Sequence< Any >& aArguments ) throw ( Exception, RuntimeException ) { if( aArguments.getLength() ) { - aArguments[0] >>= m_Locale; - m_rAnyCompare = new AnyCompare( m_rFactory, m_Locale ); + if( aArguments[0] >>= m_Locale ) + { + m_rAnyCompare = new AnyCompare( m_rFactory, m_Locale ); + return; + } } + + throw IllegalArgumentException( OUString::createFromAscii( "The Any object does not contain Locale!\n" ), + Reference< XInterface >(), + 1 ); } OUString SAL_CALL AnyCompareFactory::getImplementationName( ) throw( RuntimeException ) |