diff options
author | Jean-Noël Rouvignac <jn.rouvignac@gmail.com> | 2013-01-30 11:44:23 +0100 |
---|---|---|
committer | Luboš Luňák <l.lunak@suse.cz> | 2013-01-30 12:54:40 +0000 |
commit | 97eb8a6e0eb830f37dcba64a51d725aab4c5ff53 (patch) | |
tree | a1a95b8249052d846a997ad1729758168d6a3b24 /lingucomponent/source | |
parent | UNO constants cannot be of CHAR type (diff) | |
download | core-97eb8a6e0eb830f37dcba64a51d725aab4c5ff53.tar.gz core-97eb8a6e0eb830f37dcba64a51d725aab4c5ff53.zip |
Removed several useless macros: A2OU, A2S, C2U, C2S, OUSTR, OUSTRING
Change-Id: Ie859cb2dfdc7103c379fce56be88eef8fe390afd
Reviewed-on: https://gerrit.libreoffice.org/1924
Tested-by: Luboš Luňák <l.lunak@suse.cz>
Reviewed-by: Luboš Luňák <l.lunak@suse.cz>
Diffstat (limited to 'lingucomponent/source')
10 files changed, 60 insertions, 66 deletions
diff --git a/lingucomponent/source/hyphenator/altlinuxhyph/hyphen/hyphenimp.cxx b/lingucomponent/source/hyphenator/altlinuxhyph/hyphen/hyphenimp.cxx index cc9bfb70f5d6..98f7e96c24fa 100644 --- a/lingucomponent/source/hyphenator/altlinuxhyph/hyphen/hyphenimp.cxx +++ b/lingucomponent/source/hyphenator/altlinuxhyph/hyphen/hyphenimp.cxx @@ -123,8 +123,8 @@ Sequence< Locale > SAL_CALL Hyphenator::getLocales() // new configuration entries). std::list< SvtLinguConfigDictionaryEntry > aDics; uno::Sequence< rtl::OUString > aFormatList; - aLinguCfg.GetSupportedDictionaryFormatsFor( A2OU("Hyphenators"), - A2OU("org.openoffice.lingu.LibHnjHyphenator"), aFormatList ); + aLinguCfg.GetSupportedDictionaryFormatsFor( "Hyphenators", + "org.openoffice.lingu.LibHnjHyphenator", aFormatList ); sal_Int32 nLen = aFormatList.getLength(); for (sal_Int32 i = 0; i < nLen; ++i) { @@ -291,7 +291,7 @@ Reference< XHyphenatedWord > SAL_CALL Hyphenator::hyphenate( const ::rtl::OUStri // if this dictinary has not been loaded yet do that if (!aDicts[k].aPtr) { - OUString DictFN = aDicts[k].aName + A2OU(".dic"); + OUString DictFN = aDicts[k].aName + ".dic"; OUString dictpath; osl::FileBase::getSystemPathFromFileURL( DictFN, dictpath ); @@ -552,7 +552,7 @@ Reference< XPossibleHyphens > SAL_CALL Hyphenator::createPossibleHyphens( const // if this dictioanry has not been loaded yet do that if (!aDicts[k].aPtr) { - OUString DictFN = aDicts[k].aName + A2OU(".dic"); + OUString DictFN = aDicts[k].aName + ".dic"; OUString dictpath; osl::FileBase::getSystemPathFromFileURL( DictFN, dictpath ); @@ -777,7 +777,7 @@ OUString SAL_CALL Hyphenator::getServiceDisplayName( const Locale& /*rLocale*/ ) throw(RuntimeException) { MutexGuard aGuard( GetLinguMutex() ); - return A2OU( "Libhyphen Hyphenator" ); + return OUString( "Libhyphen Hyphenator" ); } @@ -891,7 +891,7 @@ Sequence< OUString > Hyphenator::getSupportedServiceNames_Static() MutexGuard aGuard( GetLinguMutex() ); Sequence< OUString > aSNS( 1 ); // auch mehr als 1 Service moeglich - aSNS.getArray()[0] = A2OU( SN_HYPHENATOR ); + aSNS.getArray()[0] = SN_HYPHENATOR; return aSNS; } diff --git a/lingucomponent/source/hyphenator/altlinuxhyph/hyphen/hyphenimp.hxx b/lingucomponent/source/hyphenator/altlinuxhyph/hyphen/hyphenimp.hxx index 73010fbfbf90..373d79a6248b 100644 --- a/lingucomponent/source/hyphenator/altlinuxhyph/hyphen/hyphenimp.hxx +++ b/lingucomponent/source/hyphenator/altlinuxhyph/hyphen/hyphenimp.hxx @@ -139,7 +139,7 @@ private: inline OUString Hyphenator::getImplementationName_Static() throw() { - return A2OU( "org.openoffice.lingu.LibHnjHyphenator" ); + return OUString( "org.openoffice.lingu.LibHnjHyphenator" ); } diff --git a/lingucomponent/source/languageguessing/guesslang.cxx b/lingucomponent/source/languageguessing/guesslang.cxx index 981de86baf84..c675b1c8bcf5 100644 --- a/lingucomponent/source/languageguessing/guesslang.cxx +++ b/lingucomponent/source/languageguessing/guesslang.cxx @@ -56,21 +56,19 @@ using namespace ::com::sun::star::linguistic2; //================================================================================================== -#define A2OU(x) ::rtl::OUString::createFromAscii( x ) - #define SERVICENAME "com.sun.star.linguistic2.LanguageGuessing" #define IMPLNAME "com.sun.star.lingu2.LanguageGuessing" static Sequence< OUString > getSupportedServiceNames_LangGuess_Impl() { Sequence<OUString> names(1); - names[0] = A2OU( SERVICENAME ); + names[0] = SERVICENAME; return names; } static OUString getImplementationName_LangGuess_Impl() { - return A2OU( IMPLNAME ); + return OUString( IMPLNAME ); } static osl::Mutex & GetLangGuessMutex() @@ -200,8 +198,8 @@ Locale SAL_CALL LangGuess_Impl::guessPrimaryLanguage( { OString o( OUStringToOString( rText.copy(nStartPos, nLen), RTL_TEXTENCODING_UTF8 ) ); Guess g = m_aGuesser.GuessPrimaryLanguage(o.getStr()); - aRes.Language = OUString::createFromAscii(g.GetLanguage().c_str()); - aRes.Country = OUString::createFromAscii(g.GetCountry().c_str()); + aRes.Language = OUString::createFromAscii( g.GetLanguage().c_str() ); + aRes.Country = OUString::createFromAscii( g.GetCountry().c_str() ); } else throw lang::IllegalArgumentException(); @@ -241,8 +239,8 @@ uno::Sequence< Locale > SAL_CALL LangGuess_Impl::getAvailableLanguages( ) for(size_t i = 0; i < gs.size() ; i++ ){ com::sun::star::lang::Locale current_aRes; - current_aRes.Language = A2OU( gs[i].GetLanguage().c_str() ); - current_aRes.Country = A2OU( gs[i].GetCountry().c_str() ); + current_aRes.Language = OUString::createFromAscii( gs[i].GetLanguage().c_str() ); + current_aRes.Country = OUString::createFromAscii( gs[i].GetCountry().c_str() ); pRes[i] = current_aRes; } @@ -265,8 +263,8 @@ uno::Sequence< Locale > SAL_CALL LangGuess_Impl::getEnabledLanguages( ) for(size_t i = 0; i < gs.size() ; i++ ){ com::sun::star::lang::Locale current_aRes; - current_aRes.Language = A2OU( gs[i].GetLanguage().c_str() ); - current_aRes.Country = A2OU( gs[i].GetCountry().c_str() ); + current_aRes.Language = OUString::createFromAscii( gs[i].GetLanguage().c_str() ); + current_aRes.Country = OUString::createFromAscii( gs[i].GetCountry().c_str() ); pRes[i] = current_aRes; } @@ -289,8 +287,8 @@ uno::Sequence< Locale > SAL_CALL LangGuess_Impl::getDisabledLanguages( ) for(size_t i = 0; i < gs.size() ; i++ ){ com::sun::star::lang::Locale current_aRes; - current_aRes.Language = A2OU( gs[i].GetLanguage().c_str() ); - current_aRes.Country = A2OU( gs[i].GetCountry().c_str() ); + current_aRes.Language = OUString::createFromAscii( gs[i].GetLanguage().c_str() ); + current_aRes.Country = OUString::createFromAscii( gs[i].GetCountry().c_str() ); pRes[i] = current_aRes; } @@ -354,7 +352,7 @@ OUString SAL_CALL LangGuess_Impl::getImplementationName( ) throw(RuntimeException) { osl::MutexGuard aGuard( GetLangGuessMutex() ); - return A2OU( IMPLNAME ); + return OUString( IMPLNAME ); } //************************************************************************* @@ -381,7 +379,7 @@ Sequence<OUString> SAL_CALL LangGuess_Impl::getSupportedServiceNames( ) //************************************************************************* Sequence<OUString> SAL_CALL LangGuess_Impl::getSupportedServiceNames_Static( ) { - OUString aName( A2OU( SERVICENAME ) ); + OUString aName( SERVICENAME ); return Sequence< OUString >( &aName, 1 ); } diff --git a/lingucomponent/source/lingutil/lingutil.cxx b/lingucomponent/source/lingutil/lingutil.cxx index 8754442e471f..fc3818f219b6 100644 --- a/lingucomponent/source/lingutil/lingutil.cxx +++ b/lingucomponent/source/lingutil/lingutil.cxx @@ -91,31 +91,31 @@ std::vector< SvtLinguConfigDictionaryEntry > GetOldStyleDics( const char *pDicTy #endif if (strcmp( pDicType, "DICT" ) == 0) { - aFormatName = A2OU("DICT_SPELL"); - aDicExtension = rtl::OUString( ".dic" ); + aFormatName = "DICT_SPELL"; + aDicExtension = ".dic"; #ifdef SYSTEM_DICTS - aSystemDir = A2OU( DICT_SYSTEM_DIR ); - aSystemSuffix = aDicExtension; + aSystemDir = DICT_SYSTEM_DIR; + aSystemSuffix = aDicExtension; #endif } else if (strcmp( pDicType, "HYPH" ) == 0) { - aFormatName = A2OU("DICT_HYPH"); - aDicExtension = rtl::OUString( ".dic" ); + aFormatName = "DICT_HYPH"; + aDicExtension = ".dic"; #ifdef SYSTEM_DICTS - aSystemDir = A2OU( HYPH_SYSTEM_DIR ); - aSystemPrefix = A2OU( "hyph_" ); - aSystemSuffix = aDicExtension; + aSystemDir = HYPH_SYSTEM_DIR; + aSystemPrefix = "hyph_"; + aSystemSuffix = aDicExtension; #endif } else if (strcmp( pDicType, "THES" ) == 0) { - aFormatName = A2OU("DICT_THES"); - aDicExtension = rtl::OUString( ".dat" ); + aFormatName = "DICT_THES"; + aDicExtension = ".dat"; #ifdef SYSTEM_DICTS - aSystemDir = A2OU( THES_SYSTEM_DIR ); - aSystemPrefix = A2OU( "th_" ); - aSystemSuffix = A2OU( "_v2.dat" ); + aSystemDir = THES_SYSTEM_DIR; + aSystemPrefix = "th_"; + aSystemSuffix = "_v2.dat"; #endif } diff --git a/lingucomponent/source/lingutil/lingutil.hxx b/lingucomponent/source/lingutil/lingutil.hxx index 3f1c998906a1..1e6a3de79f7b 100644 --- a/lingucomponent/source/lingutil/lingutil.hxx +++ b/lingucomponent/source/lingutil/lingutil.hxx @@ -30,10 +30,6 @@ #include <list> -#ifndef A2OU -# define A2OU(x) ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( x )) -#endif - #define OU2ENC(rtlOUString, rtlEncoding) \ ::rtl::OString((rtlOUString).getStr(), (rtlOUString).getLength(), \ rtlEncoding, RTL_UNICODETOTEXT_FLAGS_UNDEFINED_QUESTIONMARK).getStr() diff --git a/lingucomponent/source/spellcheck/macosxspell/macspellimp.hxx b/lingucomponent/source/spellcheck/macosxspell/macspellimp.hxx index cc5bc426efeb..135b1b278ac6 100644 --- a/lingucomponent/source/spellcheck/macosxspell/macspellimp.hxx +++ b/lingucomponent/source/spellcheck/macosxspell/macspellimp.hxx @@ -132,7 +132,7 @@ public: inline OUString MacSpellChecker::getImplementationName_Static() throw() { - return A2OU( "org.openoffice.lingu.MacOSXSpellChecker" ); + return OUString( "org.openoffice.lingu.MacOSXSpellChecker" ); } diff --git a/lingucomponent/source/spellcheck/spell/sspellimp.cxx b/lingucomponent/source/spellcheck/spell/sspellimp.cxx index 273743b57057..6ed090764f04 100644 --- a/lingucomponent/source/spellcheck/spell/sspellimp.cxx +++ b/lingucomponent/source/spellcheck/spell/sspellimp.cxx @@ -126,8 +126,8 @@ Sequence< Locale > SAL_CALL SpellChecker::getLocales() // new configuration entries). std::list< SvtLinguConfigDictionaryEntry > aDics; uno::Sequence< rtl::OUString > aFormatList; - aLinguCfg.GetSupportedDictionaryFormatsFor( A2OU("SpellCheckers"), - A2OU("org.openoffice.lingu.MySpellSpellChecker"), aFormatList ); + aLinguCfg.GetSupportedDictionaryFormatsFor( "SpellCheckers", + "org.openoffice.lingu.MySpellSpellChecker", aFormatList ); sal_Int32 nLen = aFormatList.getLength(); for (sal_Int32 i = 0; i < nLen; ++i) { @@ -295,8 +295,8 @@ sal_Int16 SpellChecker::GetSpellFailure( const OUString &rWord, const Locale &rL { if (!aDicts[i]) { - OUString dicpath = aDNames[i] + A2OU(".dic"); - OUString affpath = aDNames[i] + A2OU(".aff"); + OUString dicpath = aDNames[i] + ".dic"; + OUString affpath = aDNames[i] + ".aff"; OUString dict; OUString aff; osl::FileBase::getSystemPathFromFileURL(dicpath,dict); @@ -360,7 +360,7 @@ sal_Bool SAL_CALL SpellChecker::isValid( const OUString& rWord, const Locale& rL return sal_True; // return sal_False to process SPELLML requests (they are longer than the header) - if (rWord.match(A2OU(SPELLML_HEADER), 0) && (rWord.getLength() > 10)) return sal_False; + if (rWord.match(SPELLML_HEADER, 0) && (rWord.getLength() > 10)) return sal_False; // Get property values to be used. // These are be the default values set in the SN_LINGU_PROPERTIES @@ -373,7 +373,7 @@ sal_Bool SAL_CALL SpellChecker::isValid( const OUString& rWord, const Locale& rL rHelper.SetTmpPropVals( rProperties ); sal_Int16 nFailure = GetSpellFailure( rWord, rLocale ); - if (nFailure != -1 && !rWord.match(A2OU(SPELLML_HEADER), 0)) + if (nFailure != -1 && !rWord.match(SPELLML_HEADER, 0)) { sal_Int16 nLang = LinguLocaleToLanguage( rLocale ); // postprocess result for errors that should be ignored @@ -529,7 +529,7 @@ OUString SAL_CALL SpellChecker::getServiceDisplayName( const Locale& /*rLocale*/ throw(RuntimeException) { MutexGuard aGuard( GetLinguMutex() ); - return A2OU( "Hunspell SpellChecker" ); + return OUString( "Hunspell SpellChecker" ); } @@ -643,7 +643,7 @@ Sequence< OUString > SpellChecker::getSupportedServiceNames_Static() MutexGuard aGuard( GetLinguMutex() ); Sequence< OUString > aSNS( 1 ); // auch mehr als 1 Service moeglich - aSNS.getArray()[0] = A2OU( SN_SPELLCHECKER ); + aSNS.getArray()[0] = SN_SPELLCHECKER; return aSNS; } diff --git a/lingucomponent/source/spellcheck/spell/sspellimp.hxx b/lingucomponent/source/spellcheck/spell/sspellimp.hxx index e19e06814081..c04cc01587e9 100644 --- a/lingucomponent/source/spellcheck/spell/sspellimp.hxx +++ b/lingucomponent/source/spellcheck/spell/sspellimp.hxx @@ -122,7 +122,7 @@ public: inline OUString SpellChecker::getImplementationName_Static() throw() { - return A2OU( "org.openoffice.lingu.MySpellSpellChecker" ); + return OUString( "org.openoffice.lingu.MySpellSpellChecker" ); } diff --git a/lingucomponent/source/thesaurus/libnth/nthesimp.cxx b/lingucomponent/source/thesaurus/libnth/nthesimp.cxx index c4d0a7610b84..96cc46b8f208 100644 --- a/lingucomponent/source/thesaurus/libnth/nthesimp.cxx +++ b/lingucomponent/source/thesaurus/libnth/nthesimp.cxx @@ -147,8 +147,8 @@ Sequence< Locale > SAL_CALL Thesaurus::getLocales() // get list of dictionaries-to-use std::list< SvtLinguConfigDictionaryEntry > aDics; uno::Sequence< rtl::OUString > aFormatList; - aLinguCfg.GetSupportedDictionaryFormatsFor( A2OU("Thesauri"), - A2OU("org.openoffice.lingu.new.Thesaurus"), aFormatList ); + aLinguCfg.GetSupportedDictionaryFormatsFor( "Thesauri", + "org.openoffice.lingu.new.Thesaurus", aFormatList ); sal_Int32 nLen = aFormatList.getLength(); for (sal_Int32 i = 0; i < nLen; ++i) { @@ -334,8 +334,8 @@ Sequence < Reference < ::com::sun::star::linguistic2::XMeaning > > SAL_CALL Thes // open up and intialize this thesaurus if need be if (!aThes[i]) { - OUString datpath = aTNames[i] + A2OU(".dat"); - OUString idxpath = aTNames[i] + A2OU(".idx"); + OUString datpath = aTNames[i] + ".dat"; + OUString idxpath = aTNames[i] + ".idx"; OUString ndat; OUString nidx; osl::FileBase::getSystemPathFromFileURL(datpath,ndat); @@ -391,8 +391,8 @@ Sequence < Reference < ::com::sun::star::linguistic2::XMeaning > > SAL_CALL Thes if (stem) { - xTmpRes2 = xSpell->spell( A2OU("<?xml?><query type='analyze'><word>") + - pTerm + A2OU("</word></query>"), nLanguage, rProperties ); + xTmpRes2 = xSpell->spell( "<?xml?><query type='analyze'><word>" + + pTerm + "</word></query>", nLanguage, rProperties ); if (xTmpRes2.is()) { Sequence<OUString>seq = xTmpRes2->getAlternatives(); @@ -422,7 +422,7 @@ Sequence < Reference < ::com::sun::star::linguistic2::XMeaning > > SAL_CALL Thes if (catpos > 2) { // remove category name for affixation and casing - catst = A2OU(" ") + sTerm.copy(catpos); + catst = " " + sTerm.copy(catpos); sTerm = sTerm.copy(0, catpos); sTerm = sTerm.trim(); } @@ -430,8 +430,8 @@ Sequence < Reference < ::com::sun::star::linguistic2::XMeaning > > SAL_CALL Thes if (stem && stem2) { Reference< XSpellAlternatives > xTmpRes; - xTmpRes = xSpell->spell( A2OU("<?xml?><query type='generate'><word>") + - sTerm + A2OU("</word>") + codeTerm + A2OU("</query>"), nLanguage, rProperties ); + xTmpRes = xSpell->spell( "<?xml?><query type='generate'><word>" + + sTerm + "</word>" + codeTerm + "</query>", nLanguage, rProperties ); if (xTmpRes.is()) { Sequence<OUString>seq = xTmpRes->getAlternatives(); @@ -485,11 +485,11 @@ Sequence < Reference < ::com::sun::star::linguistic2::XMeaning > > SAL_CALL Thes stem = 1; xSpell = uno::Reference< XSpellChecker1 >( xLngSvcMgr->getSpellChecker(), UNO_QUERY ); - if (!xSpell.is() || !xSpell->isValid( A2OU(SPELLML_SUPPORT), nLanguage, rProperties )) + if (!xSpell.is() || !xSpell->isValid( SPELLML_SUPPORT, nLanguage, rProperties )) return noMeanings; Reference< XSpellAlternatives > xTmpRes; - xTmpRes = xSpell->spell( A2OU("<?xml?><query type='stem'><word>") + - rTerm + A2OU("</word></query>"), nLanguage, rProperties ); + xTmpRes = xSpell->spell( "<?xml?><query type='stem'><word>" + + rTerm + "</word></query>", nLanguage, rProperties ); if (xTmpRes.is()) { Sequence<OUString>seq = xTmpRes->getAlternatives(); @@ -505,8 +505,8 @@ Sequence < Reference < ::com::sun::star::linguistic2::XMeaning > > SAL_CALL Thes sal_Int32 pos = rTerm.lastIndexOf(' '); if (!pos) return noMeanings; - xTmpRes = xSpell->spell( A2OU("<?xml?><query type='stem'><word>") + - rTerm.copy(pos + 1) + A2OU("</word></query>"), nLanguage, rProperties ); + xTmpRes = xSpell->spell( "<?xml?><query type='stem'><word>" + + rTerm.copy(pos + 1) + "</word></query>", nLanguage, rProperties ); if (xTmpRes.is()) { Sequence<OUString>seq = xTmpRes->getAlternatives(); @@ -543,7 +543,7 @@ OUString SAL_CALL Thesaurus::getServiceDisplayName( const Locale& /*rLocale*/ ) throw(RuntimeException) { MutexGuard aGuard( GetLinguMutex() ); - return A2OU( "OpenOffice.org New Thesaurus" ); + return OUString( "OpenOffice.org New Thesaurus" ); } @@ -689,7 +689,7 @@ Sequence< OUString > Thesaurus::getSupportedServiceNames_Static() MutexGuard aGuard( GetLinguMutex() ); Sequence< OUString > aSNS( 1 ); // auch mehr als 1 Service moeglich - aSNS.getArray()[0] = A2OU( SN_THESAURUS ); + aSNS.getArray()[0] = SN_THESAURUS; return aSNS; } diff --git a/lingucomponent/source/thesaurus/libnth/nthesimp.hxx b/lingucomponent/source/thesaurus/libnth/nthesimp.hxx index b3d4c5f5da41..c12ea6993e2d 100644 --- a/lingucomponent/source/thesaurus/libnth/nthesimp.hxx +++ b/lingucomponent/source/thesaurus/libnth/nthesimp.hxx @@ -149,7 +149,7 @@ private: inline OUString Thesaurus::getImplementationName_Static() throw() { - return A2OU( "org.openoffice.lingu.new.Thesaurus" ); + return OUString( "org.openoffice.lingu.new.Thesaurus" ); } |