diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2024-05-01 20:39:06 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2024-05-02 08:19:24 +0200 |
commit | 656f66b4bdefdcbeee05cba6f1fffb4fadc9319d (patch) | |
tree | b406725cd3ff39ea1fc9cc910d3c4c2d1504b4e6 /unotools | |
parent | 6c4760f89cf28688497414946457c04253a845be (diff) |
use more OUString in StarSymbolToMSMultiFontImpl
Change-Id: I995e74653196d0715559127341fdf91a0d68c253
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166977
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'unotools')
-rw-r--r-- | unotools/source/misc/fontcvt.cxx | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/unotools/source/misc/fontcvt.cxx b/unotools/source/misc/fontcvt.cxx index 5abda6fdf9b2..60d2edb7788b 100644 --- a/unotools/source/misc/fontcvt.cxx +++ b/unotools/source/misc/fontcvt.cxx @@ -1018,10 +1018,10 @@ enum SymbolFont } -const char * const aSymbolNames[] = +constexpr OUString aSymbolNames[] = { - "Symbol", "Wingdings", "Monotype Sorts", "Webdings", "Wingdings 2", - "Wingdings 3", "MT Extra", "Times New Roman" + u"Symbol"_ustr, u"Wingdings"_ustr, u"Monotype Sorts"_ustr, u"Webdings"_ustr, u"Wingdings 2"_ustr, + u"Wingdings 3"_ustr, u"MT Extra"_ustr, u"Times New Roman"_ustr }; namespace { @@ -1199,9 +1199,9 @@ StarSymbolToMSMultiFontImpl::StarSymbolToMSMultiFontImpl() } } -static const char *SymbolFontToString(int nResult) +static const OUString & SymbolFontToString(int nResult) { - const char * const *ppName = aSymbolNames; + const OUString *ppName = aSymbolNames; int nI = Symbol; while (nI <= nResult) { @@ -1224,8 +1224,7 @@ OUString StarSymbolToMSMultiFontImpl::ConvertChar(sal_Unicode &rChar) if (aResult != maMagicMap.end()) { const SymbolEntry &rEntry = (*aResult).second; - const char* pc = SymbolFontToString(rEntry.eFont); - sRet = OUString(pc, strlen(pc), RTL_TEXTENCODING_ASCII_US); + sRet = SymbolFontToString(rEntry.eFont); rChar = rEntry.cIndex; } |