diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2014-12-12 12:22:32 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2014-12-12 12:22:32 +0100 |
commit | fc45562945127b73d76deb1101ce7a9ba9135054 (patch) | |
tree | bdc4236f39536840df088df89238b7eaffde7914 /svl | |
parent | ba7605c8c0d5515bb055e46354ee806cb6a31ed4 (diff) |
svl: Use appropriate OUString functions on string constants
Change-Id: I8d8528c74bae3de67a0a9bdd727cd0d8c8304d3e
Diffstat (limited to 'svl')
-rw-r--r-- | svl/source/misc/inettype.cxx | 24 | ||||
-rw-r--r-- | svl/source/numbers/numfmuno.cxx | 42 | ||||
-rw-r--r-- | svl/source/numbers/zformat.cxx | 6 | ||||
-rw-r--r-- | svl/source/uno/pathservice.cxx | 3 |
4 files changed, 38 insertions, 37 deletions
diff --git a/svl/source/misc/inettype.cxx b/svl/source/misc/inettype.cxx index d332d9a55238..38a625a0c12a 100644 --- a/svl/source/misc/inettype.cxx +++ b/svl/source/misc/inettype.cxx @@ -713,34 +713,34 @@ INetContentType INetContentTypes::GetContentTypeFromURL(OUString const & rURL) { OUString aSecondPart = rURL.getToken(1, ':'); aToken = aSecondPart.getToken(0, '/'); - if (aToken.equalsAscii(INETTYPE_URL_SUB_FACTORY)) + if (aToken == "factory") { aToken = aSecondPart.getToken(1, '/'); - if (aToken.equalsAscii(INETTYPE_URL_SSUB_SWRITER)) + if (aToken == "swriter") { aToken = aSecondPart.getToken(2, '/'); - eTypeID = aToken.equalsAscii(INETTYPE_URL_SSSUB_WEB) ? + eTypeID = aToken == "web" ? CONTENT_TYPE_APP_VND_WRITER_WEB : - aToken.equalsAscii(INETTYPE_URL_SSSUB_GLOB) ? + aToken == "GlobalDocument" ? CONTENT_TYPE_APP_VND_WRITER_GLOBAL : CONTENT_TYPE_APP_VND_WRITER; } - else if (aToken.equalsAscii(INETTYPE_URL_SSUB_SCALC)) + else if (aToken == "scalc") eTypeID = CONTENT_TYPE_APP_VND_CALC; - else if (aToken.equalsAscii(INETTYPE_URL_SSUB_SDRAW)) + else if (aToken == "sdraw") eTypeID = CONTENT_TYPE_APP_VND_DRAW; - else if (aToken.equalsAscii(INETTYPE_URL_SSUB_SIMPRESS)) + else if (aToken == "simpress") eTypeID = CONTENT_TYPE_APP_VND_IMPRESS; - else if (aToken.equalsAscii(INETTYPE_URL_SSUB_SCHART)) + else if (aToken == "schart") eTypeID = CONTENT_TYPE_APP_VND_CHART; - else if (aToken.equalsAscii(INETTYPE_URL_SSUB_SIMAGE)) + else if (aToken == "simage") eTypeID = CONTENT_TYPE_APP_VND_IMAGE; - else if (aToken.equalsAscii(INETTYPE_URL_SSUB_SMATH)) + else if (aToken == "smath") eTypeID = CONTENT_TYPE_APP_VND_MATH; - else if (aToken.equalsAscii(INETTYPE_URL_SSUB_FRAMESET)) + else if (aToken == "frameset") eTypeID = CONTENT_TYPE_APP_FRAMESET; } - else if (aToken.equalsAscii(INETTYPE_URL_SUB_HELPID)) + else if (aToken == "helpid") eTypeID = CONTENT_TYPE_APP_STARHELP; } else if (aToken.equalsIgnoreAsciiCase(INETTYPE_URL_PROT_MAILTO)) diff --git a/svl/source/numbers/numfmuno.cxx b/svl/source/numbers/numfmuno.cxx index 9cfde4162113..ea1d0fa92c3d 100644 --- a/svl/source/numbers/numfmuno.cxx +++ b/svl/source/numbers/numfmuno.cxx @@ -731,67 +731,67 @@ uno::Any SAL_CALL SvNumberFormatObj::getPropertyValue( const OUString& aProperty bool bThousand, bRed; sal_uInt16 nDecimals, nLeading; - if (aPropertyName.equalsAscii( PROPERTYNAME_FMTSTR )) + if (aPropertyName == PROPERTYNAME_FMTSTR) { aRet <<= OUString( pFormat->GetFormatstring() ); } - else if (aPropertyName.equalsAscii( PROPERTYNAME_LOCALE )) + else if (aPropertyName == PROPERTYNAME_LOCALE) { lang::Locale aLocale( LanguageTag( pFormat->GetLanguage()).getLocale()); aRet <<= aLocale; } - else if (aPropertyName.equalsAscii( PROPERTYNAME_TYPE )) + else if (aPropertyName == PROPERTYNAME_TYPE) { aRet <<= (sal_Int16)( pFormat->GetType() ); } - else if (aPropertyName.equalsAscii( PROPERTYNAME_COMMENT )) + else if (aPropertyName == PROPERTYNAME_COMMENT) { aRet <<= OUString( pFormat->GetComment() ); } - else if (aPropertyName.equalsAscii( PROPERTYNAME_STDFORM )) + else if (aPropertyName == PROPERTYNAME_STDFORM) { //! Pass through SvNumberformat Member bStandard? sal_Bool bStandard = ( ( nKey % SV_COUNTRY_LANGUAGE_OFFSET ) == 0 ); aRet.setValue( &bStandard, getBooleanCppuType() ); } - else if (aPropertyName.equalsAscii( PROPERTYNAME_USERDEF )) + else if (aPropertyName == PROPERTYNAME_USERDEF) { sal_Bool bUserDef = ( ( pFormat->GetType() & NUMBERFORMAT_DEFINED ) != 0 ); aRet.setValue( &bUserDef, getBooleanCppuType() ); } - else if (aPropertyName.equalsAscii( PROPERTYNAME_DECIMALS )) + else if (aPropertyName == PROPERTYNAME_DECIMALS) { pFormat->GetFormatSpecialInfo( bThousand, bRed, nDecimals, nLeading ); aRet <<= (sal_Int16)( nDecimals ); } - else if (aPropertyName.equalsAscii( PROPERTYNAME_LEADING )) + else if (aPropertyName == PROPERTYNAME_LEADING) { pFormat->GetFormatSpecialInfo( bThousand, bRed, nDecimals, nLeading ); aRet <<= (sal_Int16)( nLeading ); } - else if (aPropertyName.equalsAscii( PROPERTYNAME_NEGRED )) + else if (aPropertyName == PROPERTYNAME_NEGRED) { pFormat->GetFormatSpecialInfo( bThousand, bRed, nDecimals, nLeading ); aRet.setValue( &bRed, getBooleanCppuType() ); } - else if (aPropertyName.equalsAscii( PROPERTYNAME_THOUS )) + else if (aPropertyName == PROPERTYNAME_THOUS) { pFormat->GetFormatSpecialInfo( bThousand, bRed, nDecimals, nLeading ); aRet.setValue( &bThousand, getBooleanCppuType() ); } - else if (aPropertyName.equalsAscii( PROPERTYNAME_CURRSYM )) + else if (aPropertyName == PROPERTYNAME_CURRSYM) { OUString aSymbol, aExt; pFormat->GetNewCurrencySymbol( aSymbol, aExt ); aRet <<= aSymbol; } - else if (aPropertyName.equalsAscii( PROPERTYNAME_CURREXT )) + else if (aPropertyName == PROPERTYNAME_CURREXT) { OUString aSymbol, aExt; pFormat->GetNewCurrencySymbol( aSymbol, aExt ); aRet <<= aExt; } - else if (aPropertyName.equalsAscii( PROPERTYNAME_CURRABB )) + else if (aPropertyName == PROPERTYNAME_CURRABB) { OUString aSymbol, aExt; bool bBank = false; @@ -975,25 +975,25 @@ void SAL_CALL SvNumberFormatSettingsObj::setPropertyValue( const OUString& aProp SvNumberFormatter* pFormatter = rSupplier.GetNumberFormatter(); if (pFormatter) { - if (aPropertyName.equalsAscii( PROPERTYNAME_NOZERO )) + if (aPropertyName == PROPERTYNAME_NOZERO) { // operator >>= shouldn't be used for bool (?) if ( aValue.getValueTypeClass() == uno::TypeClass_BOOLEAN ) pFormatter->SetNoZero( *(sal_Bool*)aValue.getValue() ); } - else if (aPropertyName.equalsAscii( PROPERTYNAME_NULLDATE )) + else if (aPropertyName == PROPERTYNAME_NULLDATE) { util::Date aDate; if ( aValue >>= aDate ) pFormatter->ChangeNullDate( aDate.Day, aDate.Month, aDate.Year ); } - else if (aPropertyName.equalsAscii( PROPERTYNAME_STDDEC )) + else if (aPropertyName == PROPERTYNAME_STDDEC) { sal_Int16 nInt16 = sal_Int16(); if ( aValue >>= nInt16 ) pFormatter->ChangeStandardPrec( nInt16 ); } - else if (aPropertyName.equalsAscii( PROPERTYNAME_TWODIGIT )) + else if (aPropertyName == PROPERTYNAME_TWODIGIT) { sal_Int16 nInt16 = sal_Int16(); if ( aValue >>= nInt16 ) @@ -1018,12 +1018,12 @@ uno::Any SAL_CALL SvNumberFormatSettingsObj::getPropertyValue( const OUString& a SvNumberFormatter* pFormatter = rSupplier.GetNumberFormatter(); if (pFormatter) { - if (aPropertyName.equalsAscii( PROPERTYNAME_NOZERO )) + if (aPropertyName == PROPERTYNAME_NOZERO) { sal_Bool bNoZero = pFormatter->GetNoZero(); aRet.setValue( &bNoZero, getBooleanCppuType() ); } - else if (aPropertyName.equalsAscii( PROPERTYNAME_NULLDATE )) + else if (aPropertyName == PROPERTYNAME_NULLDATE) { Date* pDate = pFormatter->GetNullDate(); if (pDate) @@ -1032,9 +1032,9 @@ uno::Any SAL_CALL SvNumberFormatSettingsObj::getPropertyValue( const OUString& a aRet <<= aUnoDate; } } - else if (aPropertyName.equalsAscii( PROPERTYNAME_STDDEC )) + else if (aPropertyName == PROPERTYNAME_STDDEC) aRet <<= (sal_Int16)( pFormatter->GetStandardPrec() ); - else if (aPropertyName.equalsAscii( PROPERTYNAME_TWODIGIT )) + else if (aPropertyName == PROPERTYNAME_TWODIGIT) aRet <<= (sal_Int16)( pFormatter->GetYear2000() ); else throw beans::UnknownPropertyException(); diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx index 7efc8e8c5147..cb95094361d2 100644 --- a/svl/source/numbers/zformat.cxx +++ b/svl/source/numbers/zformat.cxx @@ -4540,7 +4540,7 @@ bool SvNumberformat::HasPositiveBracketPlaceholder() const { sal_uInt16 nAnz = NumFor[0].GetCount(); OUString *tmpStr = NumFor[0].Info().sStrArray; - return (tmpStr[nAnz-1].equalsAscii( "_)" )); + return tmpStr[nAnz-1] == "_)"; } DateFormat SvNumberformat::GetDateOrder() const @@ -4837,7 +4837,7 @@ OUString SvNumberformat::GetMappedFormatstring( const NfKeywordTable& rKeywords, } break; case NF_SYMBOLTYPE_CALDEL : - if ( pStr[j+1].equalsAscii("buddhist") ) + if ( pStr[j+1] == "buddhist" ) { aStr.insert( 0, "[$-" ); if ( rNum.IsSet() && rNum.GetNatNum() == 1 && @@ -4862,7 +4862,7 @@ OUString SvNumberformat::GetMappedFormatstring( const NfKeywordTable& rKeywords, } // The Thai T NatNum modifier during Xcl export. if (rNum.IsSet() && rNum.GetNatNum() == 1 && - rKeywords[NF_KEY_THAI_T].equalsAscii( "T") && + rKeywords[NF_KEY_THAI_T] == "T" && MsLangId::getRealLanguage( rNum.GetLang()) == LANGUAGE_THAI && !LCIDInserted ) { diff --git a/svl/source/uno/pathservice.cxx b/svl/source/uno/pathservice.cxx index 0a071fcc02cd..8ad781fd674f 100644 --- a/svl/source/uno/pathservice.cxx +++ b/svl/source/uno/pathservice.cxx @@ -22,6 +22,7 @@ #include <sal/types.h> #include <rtl/ustring.hxx> #include <cppuhelper/implbase2.hxx> +#include <cppuhelper/supportsservice.hxx> #include <com/sun/star/frame/XConfigManager.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> @@ -45,7 +46,7 @@ public: const OUString & rName) throw(css::uno::RuntimeException, std::exception) SAL_OVERRIDE { - return rName.equalsAscii("com.sun.star.config.SpecialConfigManager"); + return cppu::supportsService(this, rName); } virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() |