unotools/source/misc/fontcvt.cxx | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-)
New commits: commit 656f66b4bdefdcbeee05cba6f1fffb4fadc9319d Author: Noel Grandin <noelgran...@gmail.com> AuthorDate: Wed May 1 20:39:06 2024 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Thu May 2 08:19:24 2024 +0200 use more OUString in StarSymbolToMSMultiFontImpl Change-Id: I995e74653196d0715559127341fdf91a0d68c253 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166977 Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> Tested-by: Noel Grandin <noel.gran...@collabora.co.uk> 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; }