summaryrefslogtreecommitdiff
path: root/xfa/fxfa/app/xfa_fontmgr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'xfa/fxfa/app/xfa_fontmgr.cpp')
-rw-r--r--xfa/fxfa/app/xfa_fontmgr.cpp10
1 files changed, 3 insertions, 7 deletions
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);