From f0b65545313f065790de7f91c02e5dd160753abd Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Mon, 13 Feb 2017 10:26:01 -0800 Subject: Simplify FX_UTF8Encode variants. Doing so reveals places where there are needless copies and conversions. Change-Id: I24a868d40aa63836f4167eaf4541964049df7916 Reviewed-on: https://pdfium-review.googlesource.com/2555 Commit-Queue: Tom Sepez Reviewed-by: dsinclair --- xfa/fgas/font/cfgas_fontmgr.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'xfa/fgas/font') diff --git a/xfa/fgas/font/cfgas_fontmgr.cpp b/xfa/fgas/font/cfgas_fontmgr.cpp index add66899a7..bf243a49c6 100644 --- a/xfa/fgas/font/cfgas_fontmgr.cpp +++ b/xfa/fgas/font/cfgas_fontmgr.cpp @@ -629,7 +629,7 @@ CFX_RetainPtr CFGAS_FontMgr::GetFontByCodePage( const FX_WCHAR* pszFontFamily) { CFX_ByteString bsHash; bsHash.Format("%d, %d", wCodePage, dwFontStyles); - bsHash += CFX_WideString(pszFontFamily).UTF8Encode(); + bsHash += FX_UTF8Encode(CFX_WideStringC(pszFontFamily)); uint32_t dwHash = FX_HashCode_GetA(bsHash.AsStringC(), false); std::vector>* pFontArray = &m_Hash2Fonts[dwHash]; if (!pFontArray->empty()) @@ -673,7 +673,7 @@ CFX_RetainPtr CFGAS_FontMgr::GetFontByUnicode( bsHash.Format("%d, %d, %d", wCodePage, wBitField, dwFontStyles); else bsHash.Format("%d, %d", wCodePage, dwFontStyles); - bsHash += CFX_WideString(pszFontFamily).UTF8Encode(); + bsHash += FX_UTF8Encode(CFX_WideStringC(pszFontFamily)); uint32_t dwHash = FX_HashCode_GetA(bsHash.AsStringC(), false); std::vector>* pFonts = &m_Hash2Fonts[dwHash]; for (size_t i = 0; i < pFonts->size(); ++i) { -- cgit v1.2.3