From 20d6b76d82a762e75e8c2a89976f93acd9af7467 Mon Sep 17 00:00:00 2001 From: tsepez Date: Thu, 9 Jun 2016 11:46:16 -0700 Subject: Use static_cast in xfa. Remove a few other unused casts, simplify. Review-Url: https://codereview.chromium.org/2052593003 --- xfa/fxfa/app/xfa_fontmgr.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 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 17d600dfa0..f50bf5bf86 100644 --- a/xfa/fxfa/app/xfa_fontmgr.cpp +++ b/xfa/fxfa/app/xfa_fontmgr.cpp @@ -1840,7 +1840,7 @@ CFGAS_GEFont* CXFA_PDFFontMgr::FindFont(CFX_ByteString strPsName, if (!pFontSetDict) { return NULL; } - pFontSetDict = (CPDF_Dictionary*)pFontSetDict->GetDictBy("Font"); + pFontSetDict = pFontSetDict->GetDictBy("Font"); if (!pFontSetDict) { return NULL; } @@ -1853,12 +1853,8 @@ CFGAS_GEFont* CXFA_PDFFontMgr::FindFont(CFX_ByteString strPsName, bStrictMatch)) { continue; } - CPDF_Object* pDirect = pObj->GetDirect(); - if (!pDirect || !pDirect->IsDictionary()) { - return NULL; - } - CPDF_Dictionary* pFontDict = (CPDF_Dictionary*)pDirect; - if (pFontDict->GetStringBy("Type") != "Font") { + CPDF_Dictionary* pFontDict = ToDictionary(pObj->GetDirect()); + if (!pFontDict || pFontDict->GetStringBy("Type") != "Font") { return NULL; } CPDF_Font* pPDFFont = pDoc->LoadFont(pFontDict); -- cgit v1.2.3