From bd9748d504555f100d34025d76a9e0119986bc3f Mon Sep 17 00:00:00 2001 From: tsepez Date: Wed, 13 Apr 2016 21:40:19 -0700 Subject: Remove implicit cast from CFX_WideString to (const wchar_t*) BUG= Review URL: https://codereview.chromium.org/1882043004 --- xfa/fxfa/app/xfa_fontmgr.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'xfa/fxfa/app/xfa_fontmgr.cpp') diff --git a/xfa/fxfa/app/xfa_fontmgr.cpp b/xfa/fxfa/app/xfa_fontmgr.cpp index 542fec57a3..72952a7bd9 100644 --- a/xfa/fxfa/app/xfa_fontmgr.cpp +++ b/xfa/fxfa/app/xfa_fontmgr.cpp @@ -1725,8 +1725,8 @@ const XFA_FONTINFO* XFA_GetFontINFOByFontName( _FXM_PLATFORM_ == _FXM_PLATFORM_ANDROID_ CFX_WideString wsFontNameTemp = wsFontName; wsFontNameTemp.Remove(L' '); - uint32_t dwCurFontNameHash = - FX_HashCode_String_GetW(wsFontNameTemp, wsFontNameTemp.GetLength(), TRUE); + uint32_t dwCurFontNameHash = FX_HashCode_String_GetW( + wsFontNameTemp.c_str(), wsFontNameTemp.GetLength(), TRUE); int32_t iStart = 0; int32_t iEnd = sizeof(g_XFAFontsMap) / sizeof(XFA_FONTINFO) - 1; int32_t iMid = 0; @@ -1763,7 +1763,8 @@ IFX_Font* CXFA_DefFontMgr::GetFont(CXFA_FFDoc* hDoc, uint16_t wCodePage) { CFX_WideString wsFontName = wsFontFamily; IFX_FontMgr* pFDEFontMgr = hDoc->GetApp()->GetFDEFontMgr(); - IFX_Font* pFont = pFDEFontMgr->LoadFont(wsFontName, dwFontStyles, wCodePage); + IFX_Font* pFont = + pFDEFontMgr->LoadFont(wsFontName.c_str(), dwFontStyles, wCodePage); if (!pFont) { const XFA_FONTINFO* pCurFont = XFA_GetFontINFOByFontName(wsFontName.AsStringC()); @@ -1785,7 +1786,7 @@ IFX_Font* CXFA_DefFontMgr::GetFont(CXFA_FFDoc* hDoc, } CFX_WideString wsReplace = CFX_WideString(pReplace, pNameText - pReplace); - pFont = pFDEFontMgr->LoadFont(wsReplace, dwStyle, wCodePage); + pFont = pFDEFontMgr->LoadFont(wsReplace.c_str(), dwStyle, wCodePage); if (pFont) { break; } -- cgit v1.2.3