summaryrefslogtreecommitdiff
path: root/unotools
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2022-05-13 12:11:53 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-05-14 14:43:50 +0200
commit832c17278c9497de4b4b4a461cf858e8a62420da (patch)
tree75d82d4c2ebb4d1eec114ab826b3778b2c87cdb2 /unotools
parent451efe2d7df16e61221fce4eafdba1fc7feaf60e (diff)
cache some OUString in GetEnglishSearchFontName
rather than allocating them repeatedly Change-Id: Ie0f751f589b512a97534d193e1401312ae2f2afe Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134310 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'unotools')
-rw-r--r--unotools/source/misc/fontdefs.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/unotools/source/misc/fontdefs.cxx b/unotools/source/misc/fontdefs.cxx
index 5a9157d4fb12..568110315f33 100644
--- a/unotools/source/misc/fontdefs.cxx
+++ b/unotools/source/misc/fontdefs.cxx
@@ -291,7 +291,7 @@ OUString GetEnglishSearchFontName(std::u16string_view rInName)
// translate normalized localized name to its normalized English ASCII name
if( bNeedTranslation )
{
- typedef std::unordered_map<OUString, const char*> FontNameDictionary;
+ typedef std::unordered_map<OUString, OUString> FontNameDictionary;
static FontNameDictionary const aDictionary = {
{aBatang, "batang"},
{aBatangChe, "batangche"},
@@ -452,7 +452,7 @@ OUString GetEnglishSearchFontName(std::u16string_view rInName)
FontNameDictionary::const_iterator it = aDictionary.find( rNameStr );
if( it != aDictionary.end() )
- rNameStr = OUString::createFromAscii ( it->second );
+ rNameStr = it->second;
}
return rNameStr;