Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2176)

Unified Diff: core/src/fpdfapi/fpdf_font/fpdf_font.cpp

Issue 1410343003: [Merge to XFA] Revert "Revert "Add type cast definitions for CPDF_Dictionary."" (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Rebase to origin/xfa Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « core/src/fpdfapi/fpdf_edit/fpdf_edit_create.cpp ('k') | core/src/fpdfapi/fpdf_page/fpdf_page_func.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/src/fpdfapi/fpdf_font/fpdf_font.cpp
diff --git a/core/src/fpdfapi/fpdf_font/fpdf_font.cpp b/core/src/fpdfapi/fpdf_font/fpdf_font.cpp
index c52b4fe2786907e85bb0255b11e4636cb1524499..77f7f118fccd7be7365ae4220d5a7c0d96c1e35f 100644
--- a/core/src/fpdfapi/fpdf_font/fpdf_font.cpp
+++ b/core/src/fpdfapi/fpdf_font/fpdf_font.cpp
@@ -745,10 +745,11 @@ void CPDF_Font::LoadPDFEncoding(CPDF_Object* pEncoding,
GetPredefinedEncoding(iBaseEncoding, bsEncoding);
return;
}
- if (pEncoding->GetType() != PDFOBJ_DICTIONARY) {
+
+ CPDF_Dictionary* pDict = pEncoding->AsDictionary();
+ if (!pDict)
return;
- }
- CPDF_Dictionary* pDict = (CPDF_Dictionary*)pEncoding;
+
if (iBaseEncoding != PDFFONT_ENCODING_ADOBE_SYMBOL &&
iBaseEncoding != PDFFONT_ENCODING_ZAPFDINGBATS) {
CFX_ByteString bsEncoding = pDict->GetString(FX_BSTRC("BaseEncoding"));
@@ -781,6 +782,7 @@ void CPDF_Font::LoadPDFEncoding(CPDF_Object* pEncoding,
}
}
}
+
FX_BOOL CPDF_Font::IsStandardFont() const {
if (m_FontType != PDFFONT_TYPE1) {
return FALSE;
« no previous file with comments | « core/src/fpdfapi/fpdf_edit/fpdf_edit_create.cpp ('k') | core/src/fpdfapi/fpdf_page/fpdf_page_func.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698