loplugin:ostr in lingucomponent

Change-Id: I1910fd2a7cba63404c37b7bb80b77de2443dd7a5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167386
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
This commit is contained in:
Noel Grandin 2024-05-09 13:38:04 +02:00
parent 927e66058a
commit 38c980d472
7 changed files with 20 additions and 19 deletions

View file

@ -123,8 +123,8 @@ Sequence< Locale > SAL_CALL Hyphenator::getLocales()
// new configuration entries). // new configuration entries).
std::vector< SvtLinguConfigDictionaryEntry > aDics; std::vector< SvtLinguConfigDictionaryEntry > aDics;
uno::Sequence< OUString > aFormatList; uno::Sequence< OUString > aFormatList;
aLinguCfg.GetSupportedDictionaryFormatsFor( "Hyphenators", aLinguCfg.GetSupportedDictionaryFormatsFor( u"Hyphenators"_ustr,
"org.openoffice.lingu.LibHnjHyphenator", aFormatList ); u"org.openoffice.lingu.LibHnjHyphenator"_ustr, aFormatList );
for (const auto& rFormat : aFormatList) for (const auto& rFormat : aFormatList)
{ {
std::vector< SvtLinguConfigDictionaryEntry > aTmpDic( std::vector< SvtLinguConfigDictionaryEntry > aTmpDic(
@ -961,7 +961,7 @@ void SAL_CALL Hyphenator::removeEventListener( const Reference< XEventListener >
// Service specific part // Service specific part
OUString SAL_CALL Hyphenator::getImplementationName() OUString SAL_CALL Hyphenator::getImplementationName()
{ {
return "org.openoffice.lingu.LibHnjHyphenator"; return u"org.openoffice.lingu.LibHnjHyphenator"_ustr;
} }
sal_Bool SAL_CALL Hyphenator::supportsService( const OUString& ServiceName ) sal_Bool SAL_CALL Hyphenator::supportsService( const OUString& ServiceName )

View file

@ -296,7 +296,7 @@ void SAL_CALL LangGuess_Impl::enableLanguages(
OUString SAL_CALL LangGuess_Impl::getImplementationName( ) OUString SAL_CALL LangGuess_Impl::getImplementationName( )
{ {
return "com.sun.star.lingu2.LanguageGuessing"; return u"com.sun.star.lingu2.LanguageGuessing"_ustr;
} }
sal_Bool SAL_CALL LangGuess_Impl::supportsService( const OUString& ServiceName ) sal_Bool SAL_CALL LangGuess_Impl::supportsService( const OUString& ServiceName )
@ -306,7 +306,7 @@ sal_Bool SAL_CALL LangGuess_Impl::supportsService( const OUString& ServiceName )
Sequence<OUString> SAL_CALL LangGuess_Impl::getSupportedServiceNames( ) Sequence<OUString> SAL_CALL LangGuess_Impl::getSupportedServiceNames( )
{ {
return { "com.sun.star.linguistic2.LanguageGuessing" }; return { u"com.sun.star.linguistic2.LanguageGuessing"_ustr };
} }
extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface* extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*

View file

@ -207,7 +207,7 @@ std::vector< SvtLinguConfigDictionaryEntry > GetOldStyleDics( const char *pDicTy
#ifndef IOS #ifndef IOS
// follow the hunspell tool's example and check DICPATH for preferred dictionaries // follow the hunspell tool's example and check DICPATH for preferred dictionaries
rtl_uString * pSearchPath = nullptr; rtl_uString * pSearchPath = nullptr;
osl_getEnvironment(OUString("DICPATH").pData, &pSearchPath); osl_getEnvironment(u"DICPATH"_ustr.pData, &pSearchPath);
if (pSearchPath) if (pSearchPath)
{ {

View file

@ -145,7 +145,7 @@ uno::Sequence<Locale> SAL_CALL NumberText_Impl::getAvailableLanguages()
OUString SAL_CALL NumberText_Impl::getImplementationName() OUString SAL_CALL NumberText_Impl::getImplementationName()
{ {
return "com.sun.star.lingu2.NumberText"; return u"com.sun.star.lingu2.NumberText"_ustr;
} }
sal_Bool SAL_CALL NumberText_Impl::supportsService(const OUString& ServiceName) sal_Bool SAL_CALL NumberText_Impl::supportsService(const OUString& ServiceName)
@ -155,7 +155,7 @@ sal_Bool SAL_CALL NumberText_Impl::supportsService(const OUString& ServiceName)
Sequence<OUString> SAL_CALL NumberText_Impl::getSupportedServiceNames() Sequence<OUString> SAL_CALL NumberText_Impl::getSupportedServiceNames()
{ {
return { "com.sun.star.linguistic2.NumberText" }; return { u"com.sun.star.linguistic2.NumberText"_ustr };
} }
extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface* extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*

View file

@ -83,7 +83,7 @@ PropertyValue lcl_GetLineColorPropertyFromErrorId(const std::string& rErrorId)
constexpr Color COL_ORANGE(0xD1, 0x68, 0x20); constexpr Color COL_ORANGE(0xD1, 0x68, 0x20);
aColor = COL_ORANGE; aColor = COL_ORANGE;
} }
return comphelper::makePropertyValue("LineColor", aColor); return comphelper::makePropertyValue(u"LineColor"_ustr, aColor);
} }
OString encodeTextForLT(const OUString& text) OString encodeTextForLT(const OUString& text)
@ -346,8 +346,9 @@ uno::Sequence<Locale> SAL_CALL LanguageToolGrammarChecker::getLocales()
aLocaleList.getArray()[2] = "en-GB"; aLocaleList.getArray()[2] = "en-GB";
} }
else else
aLinguCfg.GetLocaleListFor("GrammarCheckers", aLinguCfg.GetLocaleListFor(u"GrammarCheckers"_ustr,
"org.openoffice.lingu.LanguageToolGrammarChecker", aLocaleList); u"org.openoffice.lingu.LanguageToolGrammarChecker"_ustr,
aLocaleList);
auto nLength = aLocaleList.getLength(); auto nLength = aLocaleList.getLength();
m_aSuppLocales.realloc(nLength); m_aSuppLocales.realloc(nLength);
@ -494,7 +495,7 @@ OUString SAL_CALL LanguageToolGrammarChecker::getServiceDisplayName(const Locale
OUString SAL_CALL LanguageToolGrammarChecker::getImplementationName() OUString SAL_CALL LanguageToolGrammarChecker::getImplementationName()
{ {
return "org.openoffice.lingu.LanguageToolGrammarChecker"; return u"org.openoffice.lingu.LanguageToolGrammarChecker"_ustr;
} }
sal_Bool SAL_CALL LanguageToolGrammarChecker::supportsService(const OUString& ServiceName) sal_Bool SAL_CALL LanguageToolGrammarChecker::supportsService(const OUString& ServiceName)

View file

@ -118,8 +118,8 @@ Sequence< Locale > SAL_CALL SpellChecker::getLocales()
// new configuration entries). // new configuration entries).
std::vector< SvtLinguConfigDictionaryEntry > aDics; std::vector< SvtLinguConfigDictionaryEntry > aDics;
uno::Sequence< OUString > aFormatList; uno::Sequence< OUString > aFormatList;
aLinguCfg.GetSupportedDictionaryFormatsFor( "SpellCheckers", aLinguCfg.GetSupportedDictionaryFormatsFor( u"SpellCheckers"_ustr,
"org.openoffice.lingu.MySpellSpellChecker", aFormatList ); u"org.openoffice.lingu.MySpellSpellChecker"_ustr, aFormatList );
for (auto const& format : aFormatList) for (auto const& format : aFormatList)
{ {
std::vector< SvtLinguConfigDictionaryEntry > aTmpDic( std::vector< SvtLinguConfigDictionaryEntry > aTmpDic(
@ -141,7 +141,7 @@ Sequence< Locale > SAL_CALL SpellChecker::getLocales()
if (!aDics.empty()) if (!aDics.empty())
{ {
uno::Reference< lang::XMultiServiceFactory > xServiceFactory(comphelper::getProcessServiceFactory()); uno::Reference< lang::XMultiServiceFactory > xServiceFactory(comphelper::getProcessServiceFactory());
uno::Reference< ucb::XSimpleFileAccess > xAccess(xServiceFactory->createInstance("com.sun.star.ucb.SimpleFileAccess"), uno::UNO_QUERY); uno::Reference< ucb::XSimpleFileAccess > xAccess(xServiceFactory->createInstance(u"com.sun.star.ucb.SimpleFileAccess"_ustr), uno::UNO_QUERY);
// get supported locales from the dictionaries-to-use... // get supported locales from the dictionaries-to-use...
std::set<OUString> aLocaleNamesSet; std::set<OUString> aLocaleNamesSet;
for (auto const& dict : aDics) for (auto const& dict : aDics)
@ -621,7 +621,7 @@ void SAL_CALL SpellChecker::removeEventListener( const Reference< XEventListener
// Service specific part // Service specific part
OUString SAL_CALL SpellChecker::getImplementationName() OUString SAL_CALL SpellChecker::getImplementationName()
{ {
return "org.openoffice.lingu.MySpellSpellChecker"; return u"org.openoffice.lingu.MySpellSpellChecker"_ustr;
} }
sal_Bool SAL_CALL SpellChecker::supportsService( const OUString& ServiceName ) sal_Bool SAL_CALL SpellChecker::supportsService( const OUString& ServiceName )

View file

@ -106,8 +106,8 @@ Sequence< Locale > SAL_CALL Thesaurus::getLocales()
// get list of dictionaries-to-use // get list of dictionaries-to-use
std::vector< SvtLinguConfigDictionaryEntry > aDics; std::vector< SvtLinguConfigDictionaryEntry > aDics;
uno::Sequence< OUString > aFormatList; uno::Sequence< OUString > aFormatList;
aLinguCfg.GetSupportedDictionaryFormatsFor( "Thesauri", aLinguCfg.GetSupportedDictionaryFormatsFor( u"Thesauri"_ustr,
"org.openoffice.lingu.new.Thesaurus", aFormatList ); u"org.openoffice.lingu.new.Thesaurus"_ustr, aFormatList );
for (const auto& rFormat : aFormatList) for (const auto& rFormat : aFormatList)
{ {
std::vector< SvtLinguConfigDictionaryEntry > aTmpDic( std::vector< SvtLinguConfigDictionaryEntry > aTmpDic(
@ -547,7 +547,7 @@ void SAL_CALL Thesaurus::removeEventListener( const Reference< XEventListener >&
// Service specific part // Service specific part
OUString SAL_CALL Thesaurus::getImplementationName() OUString SAL_CALL Thesaurus::getImplementationName()
{ {
return "org.openoffice.lingu.new.Thesaurus"; return u"org.openoffice.lingu.new.Thesaurus"_ustr;
} }
sal_Bool SAL_CALL Thesaurus::supportsService( const OUString& ServiceName ) sal_Bool SAL_CALL Thesaurus::supportsService( const OUString& ServiceName )