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

Unified Diff: core/src/fpdfapi/fpdf_page/fpdf_page_func.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_font/fpdf_font.cpp ('k') | core/src/fpdfapi/fpdf_page/fpdf_page_graph_state.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/src/fpdfapi/fpdf_page/fpdf_page_func.cpp
diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_func.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_func.cpp
index 224c99bb69d63f68cc4eaed84953d00e502eb543..d66a9efdaa7e46e761994a581d0ec6447d815889 100644
--- a/core/src/fpdfapi/fpdf_page/fpdf_page_func.cpp
+++ b/core/src/fpdfapi/fpdf_page/fpdf_page_func.cpp
@@ -818,8 +818,8 @@ CPDF_Function* CPDF_Function::Load(CPDF_Object* pFuncObj) {
type = ((CPDF_Stream*)pFuncObj)
->GetDict()
->GetInteger(FX_BSTRC("FunctionType"));
- } else if (pFuncObj->GetType() == PDFOBJ_DICTIONARY) {
- type = ((CPDF_Dictionary*)pFuncObj)->GetInteger(FX_BSTRC("FunctionType"));
+ } else if (CPDF_Dictionary* pDict = pFuncObj->AsDictionary()) {
+ type = pDict->GetInteger(FX_BSTRC("FunctionType"));
} else {
return NULL;
}
@@ -853,7 +853,7 @@ FX_BOOL CPDF_Function::Init(CPDF_Object* pObj) {
if (pObj->GetType() == PDFOBJ_STREAM) {
pDict = ((CPDF_Stream*)pObj)->GetDict();
} else {
- pDict = (CPDF_Dictionary*)pObj;
+ pDict = pObj->AsDictionary();
}
CPDF_Array* pDomains = pDict->GetArray(FX_BSTRC("Domain"));
if (pDomains == NULL) {
« no previous file with comments | « core/src/fpdfapi/fpdf_font/fpdf_font.cpp ('k') | core/src/fpdfapi/fpdf_page/fpdf_page_graph_state.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698