include/linguistic/lngprops.hxx | 2 +- include/linguistic/misc.hxx | 8 ++++---- linguistic/source/convdic.hxx | 4 ++-- linguistic/source/lngsvcmgr.cxx | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-)
New commits: commit addf580c2846e8de6457c9e710faedd3f0a7a7de Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Fri Nov 19 11:02:19 2021 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Fri Nov 19 11:36:34 2021 +0100 loplugin:stringliteraldefine in linguistc Change-Id: Id347daab7aa21ce8756dbc2d139ac022fc22be3f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125536 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/include/linguistic/lngprops.hxx b/include/linguistic/lngprops.hxx index 9861a384b3bd..62a72f34b5aa 100644 --- a/include/linguistic/lngprops.hxx +++ b/include/linguistic/lngprops.hxx @@ -22,7 +22,7 @@ // maximal number of suggestions to be returned in spelling context-menu // (may not include results added by looking up user dictionaries) -#define UPN_MAX_NUMBER_OF_SUGGESTIONS "MaxNumberOfSuggestions" +inline constexpr OUStringLiteral UPN_MAX_NUMBER_OF_SUGGESTIONS = u"MaxNumberOfSuggestions"; #endif diff --git a/include/linguistic/misc.hxx b/include/linguistic/misc.hxx index a7addd9c3246..21da5776a690 100644 --- a/include/linguistic/misc.hxx +++ b/include/linguistic/misc.hxx @@ -46,10 +46,10 @@ class CharClass; class LocaleDataWrapper; -#define SN_GRAMMARCHECKER u"com.sun.star.linguistic2.Proofreader" -#define SN_SPELLCHECKER u"com.sun.star.linguistic2.SpellChecker" -#define SN_HYPHENATOR u"com.sun.star.linguistic2.Hyphenator" -#define SN_THESAURUS u"com.sun.star.linguistic2.Thesaurus" +inline constexpr OUStringLiteral SN_GRAMMARCHECKER = u"com.sun.star.linguistic2.Proofreader"; +inline constexpr OUStringLiteral SN_SPELLCHECKER = u"com.sun.star.linguistic2.SpellChecker"; +inline constexpr OUStringLiteral SN_HYPHENATOR = u"com.sun.star.linguistic2.Hyphenator"; +inline constexpr OUStringLiteral SN_THESAURUS = u"com.sun.star.linguistic2.Thesaurus"; namespace linguistic diff --git a/linguistic/source/convdic.hxx b/linguistic/source/convdic.hxx index df0cd955a4c9..26dc2aee0517 100644 --- a/linguistic/source/convdic.hxx +++ b/linguistic/source/convdic.hxx @@ -31,10 +31,10 @@ #include <unordered_map> // text conversion dictionary extension -#define CONV_DIC_EXT "tcd" +inline constexpr OUStringLiteral CONV_DIC_EXT = u"tcd"; #define CONV_DIC_DOT_EXT ".tcd" -#define SN_CONV_DICTIONARY "com.sun.star.linguistic2.ConversionDictionary" +inline constexpr OUStringLiteral SN_CONV_DICTIONARY = u"com.sun.star.linguistic2.ConversionDictionary"; bool IsConvDic( const OUString &rFileURL, LanguageType &nLang, sal_Int16 &nConvType ); diff --git a/linguistic/source/lngsvcmgr.cxx b/linguistic/source/lngsvcmgr.cxx index 2ae09ee4d16e..1eaef662b316 100644 --- a/linguistic/source/lngsvcmgr.cxx +++ b/linguistic/source/lngsvcmgr.cxx @@ -618,7 +618,7 @@ void LngSvcMgr::UpdateAll() SvtLinguConfig aCfg; const int nNumServices = 4; - const sal_Unicode * const apServices[nNumServices] = { SN_SPELLCHECKER, SN_GRAMMARCHECKER, SN_HYPHENATOR, SN_THESAURUS }; + static constexpr rtl::OUStringConstExpr apServices[nNumServices] = { SN_SPELLCHECKER, SN_GRAMMARCHECKER, SN_HYPHENATOR, SN_THESAURUS }; const char * const apCurLists[nNumServices] = { "ServiceManager/SpellCheckerList", "ServiceManager/GrammarCheckerList", "ServiceManager/HyphenatorList", "ServiceManager/ThesaurusList" }; const char * const apLastFoundLists[nNumServices] = { "ServiceManager/LastFoundSpellCheckers", "ServiceManager/LastFoundGrammarCheckers", "ServiceManager/LastFoundHyphenators", "ServiceManager/LastFoundThesauri" };