fdo#54938: Convert i18npool to use cppu::supportsService

Change-Id: I9acc496cd95c8362972fa0c41d35b77fc0715aba
Signed-off-by: Stephan Bergmann <sbergman@redhat.com>
This commit is contained in:
Marcos Paulo de Souza
2013-12-17 01:14:30 -02:00
committed by Stephan Bergmann
parent 910ec33b72
commit 6cd3118b63
25 changed files with 63 additions and 75 deletions

View File

@@ -21,7 +21,8 @@
#include <com/sun/star/uno/Reference.h>
#include <com/sun/star/i18n/XCollator.hpp>
#include <cppuhelper/implbase1.hxx>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <cppuhelper/implbase2.hxx>
#include <osl/module.h>
#include <unicode/tblcoll.h>
@@ -32,7 +33,7 @@
namespace com { namespace sun { namespace star { namespace i18n {
class Collator_Unicode : public cppu::WeakImplHelper1 < XCollator >
class Collator_Unicode : public cppu::WeakImplHelper2 < XCollator, com::sun::star::lang::XServiceInfo >
{
public:
// Constructors

View File

@@ -21,13 +21,17 @@
#include <com/sun/star/i18n/XExtendedTransliteration.hpp>
#include <com/sun/star/i18n/TransliterationType.hpp>
#include <cppuhelper/implbase1.hxx>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <cppuhelper/implbase2.hxx>
#include <rtl/ustrbuf.h>
#include <rtl/ustring.hxx>
namespace com { namespace sun { namespace star { namespace i18n {
class transliteration_commonclass : public cppu::WeakImplHelper1< com::sun::star::i18n::XExtendedTransliteration >
class transliteration_commonclass : public cppu::WeakImplHelper2<
com::sun::star::i18n::XExtendedTransliteration,
com::sun::star::lang::XServiceInfo
>
{
public:
transliteration_commonclass();

View File

@@ -17,8 +17,8 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <breakiteratorImpl.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <unicode/uchar.h>
#include <i18nutil/unicode.hxx>
#include <rtl/ustrbuf.hxx>
@@ -616,7 +616,7 @@ BreakIteratorImpl::getImplementationName(void) throw( RuntimeException )
sal_Bool SAL_CALL
BreakIteratorImpl::supportsService(const OUString& rServiceName) throw( RuntimeException )
{
return rServiceName.equalsAscii(cBreakIterator);
return cppu::supportsService(this, rServiceName);
}
Sequence< OUString > SAL_CALL

View File

@@ -18,6 +18,7 @@
*/
#include <breakiterator_unicode.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <localedata.hxx>
#include <i18nlangtag/languagetag.hxx>
#include <i18nlangtag/languagetagicu.hxx>
@@ -439,8 +440,6 @@ LineBreakResults SAL_CALL BreakIterator_Unicode::getLineBreak(
return lbr;
}
OUString SAL_CALL
BreakIterator_Unicode::getImplementationName(void) throw( uno::RuntimeException )
{
@@ -450,7 +449,7 @@ BreakIterator_Unicode::getImplementationName(void) throw( uno::RuntimeException
sal_Bool SAL_CALL
BreakIterator_Unicode::supportsService(const OUString& rServiceName) throw( uno::RuntimeException )
{
return rServiceName.equalsAscii(cBreakIterator);
return cppu::supportsService(this, rServiceName);
}
uno::Sequence< OUString > SAL_CALL

View File

@@ -17,10 +17,10 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include "calendarImpl.hxx"
#include "localedata.hxx"
#include <comphelper/processfactory.hxx>
#include <cppuhelper/supportsservice.hxx>
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::lang;
@@ -41,7 +41,6 @@ CalendarImpl::~CalendarImpl()
lookupTable.clear();
}
void SAL_CALL
CalendarImpl::loadDefaultCalendar( const Locale& rLocale ) throw(RuntimeException)
{
@@ -344,19 +343,17 @@ CalendarImpl::getImplementationName(void) throw( RuntimeException )
return OUString("com.sun.star.i18n.CalendarImpl");
}
const sal_Char cCalendar[] = "com.sun.star.i18n.LocaleCalendar";
sal_Bool SAL_CALL
CalendarImpl::supportsService(const OUString& rServiceName) throw( RuntimeException )
{
return rServiceName.equalsAscii(cCalendar);
return cppu::supportsService(this, rServiceName);
}
Sequence< OUString > SAL_CALL
CalendarImpl::getSupportedServiceNames(void) throw( RuntimeException )
{
Sequence< OUString > aRet(1);
aRet[0] = OUString::createFromAscii(cCalendar);
aRet[0] = "com.sun.star.i18n.LocaleCalendar";
return aRet;
}

View File

@@ -26,6 +26,7 @@
#include <com/sun/star/i18n/reservedWords.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <comphelper/processfactory.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <rtl/math.hxx>
#include <stdio.h>
@@ -1174,7 +1175,7 @@ Calendar_gregorian::getImplementationName(void) throw( RuntimeException )
sal_Bool SAL_CALL
Calendar_gregorian::supportsService(const OUString& rServiceName) throw( RuntimeException )
{
return rServiceName.equalsAscii(cCalendar);
return cppu::supportsService(this, rServiceName);
}
Sequence< OUString > SAL_CALL

View File

@@ -17,13 +17,13 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <cclass_unicode.hxx>
#include <com/sun/star/i18n/UnicodeScript.hpp>
#include <com/sun/star/i18n/UnicodeType.hpp>
#include <com/sun/star/i18n/KCharacterType.hpp>
#include <unicode/uchar.h>
#include <comphelper/string.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <breakiteratorImpl.hxx>
using namespace ::com::sun::star::uno;
@@ -267,10 +267,9 @@ OUString SAL_CALL cclass_Unicode::getImplementationName() throw( RuntimeExceptio
return OUString::createFromAscii(cClass);
}
sal_Bool SAL_CALL cclass_Unicode::supportsService(const OUString& rServiceName) throw( RuntimeException )
{
return rServiceName.equalsAscii(cClass);
return cppu::supportsService(this, rServiceName);
}
Sequence< OUString > SAL_CALL cclass_Unicode::getSupportedServiceNames() throw( RuntimeException )

View File

@@ -17,7 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <cppuhelper/supportsservice.hxx>
#include <characterclassificationImpl.hxx>
#include <localedata.hxx>
#include <rtl/ustrbuf.hxx>
@@ -25,7 +25,6 @@
using namespace com::sun::star::uno;
using namespace com::sun::star::lang;
namespace com { namespace sun { namespace star { namespace i18n {
CharacterClassificationImpl::CharacterClassificationImpl(
@@ -205,7 +204,7 @@ sal_Bool SAL_CALL
CharacterClassificationImpl::supportsService(const OUString& rServiceName)
throw( RuntimeException )
{
return rServiceName.equalsAscii(cClass);
return cppu::supportsService(this, rServiceName);
}
Sequence< OUString > SAL_CALL

View File

@@ -18,12 +18,10 @@
*/
#include "unoscripttypedetector.hxx"
#include <cppuhelper/supportsservice.hxx>
#include <i18nutil/scripttypedetector.hxx>
// ----------------------------------------------------
// class UnoScriptTypeDetector
// ----------------------------------------------------;
sal_Int16 SAL_CALL
UnoScriptTypeDetector::getScriptDirection( const OUString& Text, sal_Int32 nPos, sal_Int16 defaultScriptDirection ) throw (::com::sun::star::uno::RuntimeException)
{
@@ -74,7 +72,7 @@ UnoScriptTypeDetector::getImplementationName() throw( ::com::sun::star::uno::Run
sal_Bool SAL_CALL
UnoScriptTypeDetector::supportsService(const OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException )
{
return ServiceName != sDetector;
return cppu::supportsService(this, ServiceName);
}
::com::sun::star::uno::Sequence< OUString > SAL_CALL

View File

@@ -17,10 +17,10 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
// prevent internal compiler error with MSVC6SP3
#include <utility>
#include <cppuhelper/supportsservice.hxx>
#include <chaptercollator.hxx>
#include <com/sun/star/i18n/KCharacterType.hpp>
#include <com/sun/star/i18n/ParseResult.hpp>
@@ -85,7 +85,7 @@ ChapterCollator::getImplementationName() throw( RuntimeException )
sal_Bool SAL_CALL
ChapterCollator::supportsService(const OUString& rServiceName) throw( RuntimeException )
{
return rServiceName.equalsAscii(cChapCollator);
return cppu::supportsService(this, rServiceName);
}
Sequence< OUString > SAL_CALL

View File

@@ -17,19 +17,18 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <collatorImpl.hxx>
#include <localedata.hxx>
#include <com/sun/star/i18n/CollatorOptions.hpp>
#include <com/sun/star/i18n/LocaleData.hpp>
#include <rtl/ustrbuf.hxx>
#include <comphelper/processfactory.hxx>
#include <cppuhelper/supportsservice.hxx>
using namespace com::sun::star;
using namespace com::sun::star::lang;
using namespace com::sun::star::uno;
namespace com { namespace sun { namespace star { namespace i18n {
CollatorImpl::CollatorImpl( const Reference < XComponentContext >& rxContext ) : m_xContext(rxContext)
@@ -215,17 +214,15 @@ CollatorImpl::loadCachedCollator(const lang::Locale& rLocale, const OUString& rS
const sal_Char cCollator[] = "com.sun.star.i18n.Collator";
OUString SAL_CALL
CollatorImpl::getImplementationName() throw( RuntimeException )
OUString SAL_CALL CollatorImpl::getImplementationName() throw( RuntimeException )
{
return OUString::createFromAscii(cCollator);
}
sal_Bool SAL_CALL
CollatorImpl::supportsService(const OUString& rServiceName)
sal_Bool SAL_CALL CollatorImpl::supportsService(const OUString& rServiceName)
throw( RuntimeException )
{
return rServiceName.equalsAscii(cCollator);
return cppu::supportsService(this, rServiceName);
}
Sequence< OUString > SAL_CALL

View File

@@ -27,6 +27,7 @@
#include <collator_unicode.hxx>
#include <localedata.hxx>
#include <com/sun/star/i18n/CollatorOptions.hpp>
#include <cppuhelper/supportsservice.hxx>
using namespace ::com::sun::star;
using namespace ::com::sun::star::lang;
@@ -250,7 +251,7 @@ Collator_Unicode::getImplementationName() throw( RuntimeException )
sal_Bool SAL_CALL
Collator_Unicode::supportsService(const OUString& rServiceName) throw( RuntimeException )
{
return rServiceName.equalsAscii(implementationName);
return cppu::supportsService(this, rServiceName);
}
Sequence< OUString > SAL_CALL

View File

@@ -27,6 +27,7 @@
#include <stdio.h>
#include <string.h>
#include <comphelper/processfactory.hxx>
#include <cppuhelper/supportsservice.hxx>
// Cyrillic upper case
#define C_CYR_A "\xD0\x90"
@@ -1052,7 +1053,7 @@ OUString DefaultNumberingProvider::getImplementationName(void)
sal_Bool DefaultNumberingProvider::supportsService(const OUString& rServiceName)
throw( RuntimeException )
{
return rServiceName.equalsAscii(cDefaultNumberingProvider);
return cppu::supportsService(this, rServiceName);
}
Sequence< OUString > DefaultNumberingProvider::getSupportedServiceNames(void)

View File

@@ -18,6 +18,7 @@
*/
#include <rtl/ustrbuf.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <indexentrysupplier.hxx>
#include <localedata.hxx>
@@ -184,7 +185,7 @@ IndexEntrySupplier::getImplementationName() throw( RuntimeException )
sal_Bool SAL_CALL
IndexEntrySupplier::supportsService(const OUString& rServiceName) throw( RuntimeException )
{
return rServiceName.equalsAscii(implementationName);
return cppu::supportsService(this, rServiceName);
}
Sequence< OUString > SAL_CALL

View File

@@ -17,9 +17,9 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <indexentrysupplier_common.hxx>
#include <com/sun/star/i18n/CollatorOptions.hpp>
#include <cppuhelper/supportsservice.hxx>
#include <localedata.hxx>
using namespace ::com::sun::star::uno;
@@ -126,7 +126,7 @@ IndexEntrySupplier_Common::getImplementationName() throw( RuntimeException )
sal_Bool SAL_CALL
IndexEntrySupplier_Common::supportsService(const OUString& rServiceName) throw( RuntimeException )
{
return rServiceName.equalsAscii(implementationName);
return cppu::supportsService(this, rServiceName);
}
Sequence< OUString > SAL_CALL

View File

@@ -17,10 +17,10 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <inputsequencechecker.hxx>
#include <com/sun/star/i18n/InputSequenceCheckMode.hpp>
#include <com/sun/star/i18n/UnicodeType.hpp>
#include <cppuhelper/supportsservice.hxx>
#include <i18nutil/unicode.hxx>
#include <rtl/ustrbuf.hxx>
@@ -142,7 +142,7 @@ InputSequenceCheckerImpl::getImplementationName(void) throw( RuntimeException )
sal_Bool SAL_CALL
InputSequenceCheckerImpl::supportsService(const OUString& rServiceName) throw( RuntimeException )
{
return rServiceName.equalsAscii(serviceName);
return cppu::supportsService(this, rServiceName);
}
Sequence< OUString > SAL_CALL

View File

@@ -17,7 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <cppuhelper/supportsservice.hxx>
#include <localedata.hxx>
#include <i18nlangtag/mslangid.hxx>
#include <i18nlangtag/languagetag.hxx>
@@ -32,7 +32,6 @@ using namespace com::sun::star::uno;
using namespace com::sun::star::lang;
using namespace com::sun::star;
static const sal_Char clocaledata[] = "com.sun.star.i18n.LocaleData";
typedef sal_Unicode** (SAL_CALL * MyFunc_Type)( sal_Int16&);
@@ -1622,11 +1621,10 @@ LocaleDataImpl::getImplementationName() throw( RuntimeException )
return OUString(clocaledata);
}
sal_Bool SAL_CALL
LocaleDataImpl::supportsService(const OUString& rServiceName)
sal_Bool SAL_CALL LocaleDataImpl::supportsService(const OUString& rServiceName)
throw( RuntimeException )
{
return rServiceName == clocaledata;
return cppu::supportsService(this, rServiceName);
}
Sequence< OUString > SAL_CALL

View File

@@ -24,12 +24,12 @@
#include <localedata.hxx>
#include <data/numberchar.h>
#include <comphelper/string.hxx>
#include <cppuhelper/supportsservice.hxx>
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::lang;
using namespace ::rtl;
typedef struct {
sal_Int16 number;
const sal_Unicode *multiplierChar;
@@ -898,7 +898,7 @@ OUString SAL_CALL NativeNumberSupplier::getImplementationName() throw( RuntimeEx
sal_Bool SAL_CALL
NativeNumberSupplier::supportsService(const OUString& rServiceName) throw( RuntimeException )
{
return rServiceName.equalsAscii(implementationName);
return cppu::supportsService(this, rServiceName);
}
Sequence< OUString > SAL_CALL

View File

@@ -17,13 +17,11 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <numberformatcode.hxx>
#include <com/sun/star/i18n/KNumberFormatUsage.hpp>
#include <com/sun/star/i18n/KNumberFormatType.hpp>
#include <com/sun/star/i18n/LocaleData.hpp>
#include <cppuhelper/supportsservice.hxx>
NumberFormatCodeMapper::NumberFormatCodeMapper(
const ::com::sun::star::uno::Reference <
@@ -269,20 +267,17 @@ NumberFormatCodeMapper::getImplementationName(void)
return OUString("com.sun.star.i18n.NumberFormatCodeMapper");
}
const sal_Char cNumFormat[] = "com.sun.star.i18n.NumberFormatMapper";
sal_Bool SAL_CALL
NumberFormatCodeMapper::supportsService(const OUString& rServiceName)
sal_Bool SAL_CALL NumberFormatCodeMapper::supportsService(const OUString& rServiceName)
throw( ::com::sun::star::uno::RuntimeException )
{
return rServiceName.equalsAscii(cNumFormat);
return cppu::supportsService(this, rServiceName);
}
::com::sun::star::uno::Sequence< OUString > SAL_CALL
NumberFormatCodeMapper::getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException )
{
::com::sun::star::uno::Sequence< OUString > aRet(1);
aRet[0] = OUString::createFromAscii(cNumFormat);
aRet[0] = "com.sun.star.i18n.NumberFormatMapper";
return aRet;
}

View File

@@ -21,6 +21,7 @@
#include <i18nlangtag/languagetag.hxx>
#include <i18nlangtag/languagetagicu.hxx>
#include <comphelper/processfactory.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <string.h>
#include "ordinalsuffix.hxx"
@@ -142,7 +143,7 @@ OUString SAL_CALL OrdinalSuffix::getImplementationName(void) throw( RuntimeExcep
sal_Bool SAL_CALL OrdinalSuffix::supportsService( const OUString& rServiceName) throw( RuntimeException )
{
return rServiceName.equalsAscii(cOrdinalSuffix);
return cppu::supportsService(this, rServiceName);
}
Sequence< OUString > SAL_CALL OrdinalSuffix::getSupportedServiceNames(void) throw( RuntimeException )

View File

@@ -33,6 +33,7 @@
#include <com/sun/star/i18n/Transliteration.hpp>
#include <com/sun/star/registry/XRegistryKey.hpp>
#include <cppuhelper/factory.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <cppuhelper/weak.hxx>
#ifdef _MSC_VER
@@ -1046,11 +1047,10 @@ TextSearch::getImplementationName()
return getImplementationName_Static();
}
sal_Bool SAL_CALL
TextSearch::supportsService(const OUString& rServiceName)
sal_Bool SAL_CALL TextSearch::supportsService(const OUString& rServiceName)
throw( RuntimeException )
{
return rServiceName == cSearchName;
return cppu::supportsService(this, rServiceName);
}
Sequence< OUString > SAL_CALL

View File

@@ -17,13 +17,12 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <assert.h>
#include <cppuhelper/supportsservice.hxx>
#include <textconversion.hxx>
using namespace com::sun::star::uno;
namespace com { namespace sun { namespace star { namespace i18n {
#ifndef DISABLE_DYNLOADING
@@ -79,7 +78,7 @@ TextConversion::getImplementationName() throw( RuntimeException )
sal_Bool SAL_CALL
TextConversion::supportsService(const OUString& rServiceName) throw( RuntimeException )
{
return rServiceName.equalsAscii(implementationName);
return cppu::supportsService(this, rServiceName);
}
Sequence< OUString > SAL_CALL

View File

@@ -17,8 +17,8 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <assert.h>
#include <cppuhelper/supportsservice.hxx>
#include <textconversionImpl.hxx>
#include <localedata.hxx>
#include <i18nlangtag/languagetag.hxx>
@@ -26,7 +26,6 @@
using namespace com::sun::star::lang;
using namespace com::sun::star::uno;
namespace com { namespace sun { namespace star { namespace i18n {
TextConversionResult SAL_CALL
@@ -123,7 +122,7 @@ sal_Bool SAL_CALL
TextConversionImpl::supportsService(const OUString& rServiceName)
throw( RuntimeException )
{
return rServiceName.equalsAscii(cTextConversion);
return cppu::supportsService(this, rServiceName);
}
Sequence< OUString > SAL_CALL

View File

@@ -27,6 +27,7 @@
#include <com/sun/star/lang/XComponent.hpp>
#include <comphelper/processfactory.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <rtl/instance.hxx>
#include <rtl/string.h>
#include <rtl/ustring.hxx>
@@ -639,11 +640,10 @@ TransliterationImpl::getImplementationName() throw( RuntimeException )
return OUString::createFromAscii(cTrans);
}
sal_Bool SAL_CALL
TransliterationImpl::supportsService(const OUString& rServiceName) throw( RuntimeException )
{
return rServiceName.equalsAscii(cTrans);
return cppu::supportsService(this, rServiceName);
}
Sequence< OUString > SAL_CALL

View File

@@ -17,9 +17,9 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <transliteration_commonclass.hxx>
#include <com/sun/star/i18n/CollatorOptions.hpp>
#include <cppuhelper/supportsservice.hxx>
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::lang;
@@ -137,17 +137,15 @@ OUString SAL_CALL transliteration_commonclass::getImplementationName() throw( Ru
return OUString::createFromAscii(implementationName);
}
const sal_Char cTrans[] = "com.sun.star.i18n.Transliteration.l10n";
sal_Bool SAL_CALL transliteration_commonclass::supportsService(const OUString& rServiceName) throw( RuntimeException )
{
return rServiceName.equalsAscii(cTrans);
return cppu::supportsService(this, rServiceName);
}
Sequence< OUString > SAL_CALL transliteration_commonclass::getSupportedServiceNames() throw( RuntimeException )
{
Sequence< OUString > aRet(1);
aRet[0] = OUString::createFromAscii(cTrans);
aRet[0] = "com.sun.star.i18n.Transliteration.l10n";
return aRet;
}