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

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

Issue 1420583003: Revert "Revert "Add type cast definitions for CPDF_Dictionary."" (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: 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 7a57889a35f4d51411a2d106a8cfe3e2242aa523..10ca3113e3e5c9fb53b170f1a8b650d3d3b6052e 100644
--- a/core/src/fpdfapi/fpdf_font/fpdf_font.cpp
+++ b/core/src/fpdfapi/fpdf_font/fpdf_font.cpp
@@ -746,10 +746,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"));
@@ -782,6 +783,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