From 8b36e5cc3d5f5f579c6b060e2c40b896a4b02bc0 Mon Sep 17 00:00:00 2001 From: tsepez Date: Fri, 8 Apr 2016 09:00:35 -0700 Subject: Make CFX_WideString::FromLocal() take a CFX_ByteStringC arg It doesn't persist the string beyond the duration of the call, hence it should take the *StringC variant. Doing so avoids some allocs by changing to the *StringC ctor in a few places, at the cost of some explicit .ToByteStringC() calls (which are cheap). Review URL: https://codereview.chromium.org/1862953004 --- xfa/fgas/font/fgas_gefont.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'xfa/fgas/font') diff --git a/xfa/fgas/font/fgas_gefont.cpp b/xfa/fgas/font/fgas_gefont.cpp index 3d740ba43a..8652c742fc 100644 --- a/xfa/fgas/font/fgas_gefont.cpp +++ b/xfa/fgas/font/fgas_gefont.cpp @@ -347,9 +347,11 @@ uint8_t CFX_GEFont::GetCharSet() const { void CFX_GEFont::GetFamilyName(CFX_WideString& wsFamily) const { if (!m_pFont->GetSubstFont() || m_pFont->GetSubstFont()->m_Family.GetLength() == 0) { - wsFamily = CFX_WideString::FromLocal(m_pFont->GetFamilyName()); + wsFamily = + CFX_WideString::FromLocal(m_pFont->GetFamilyName().AsByteStringC()); } else { - wsFamily = CFX_WideString::FromLocal(m_pFont->GetSubstFont()->m_Family); + wsFamily = CFX_WideString::FromLocal( + m_pFont->GetSubstFont()->m_Family.AsByteStringC()); } } void CFX_GEFont::GetPsName(CFX_WideString& wsName) const { -- cgit v1.2.3