summaryrefslogtreecommitdiff
path: root/core/src/fpdfapi/fpdf_parser/fpdf_parser_document.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2015-10-20 13:30:34 -0400
committerDan Sinclair <dsinclair@chromium.org>2015-10-20 13:30:34 -0400
commit937840e1722d1f2b77d80575d6e710d760662c9c (patch)
treeff065615d6d91abe8e5c788da3a08386fc2d25d6 /core/src/fpdfapi/fpdf_parser/fpdf_parser_document.cpp
parentc29bee029cd5fe3f8a4ceb580235ac2d0e5ce8fd (diff)
downloadpdfium-937840e1722d1f2b77d80575d6e710d760662c9c.tar.xz
Revert "Add type cast definitions for CPDF_Dictionary."
This reverts commit 4816432671eef6467354aa252f22bb80acc315b7. Reason, broke the javascript_test Rendering PDF file /mnt/data/b/build/slave/linux/build/pdfium/out/Debug/gen/pdfium/testing/javascript/document_methods.pdf. Non-linearized path... FAILURE: document_methods.in; Command '['/mnt/data/b/build/slave/linux/build/pdfium/out/Debug/pdfium_test', '/mnt/data/b/build/slave/linux/build/pdfium/out/Debug/gen/pdfium/testing/javascript/document_methods.pdf']' returned non-zero exit status -11 BUG=pdfium:201 TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1412413002 .
Diffstat (limited to 'core/src/fpdfapi/fpdf_parser/fpdf_parser_document.cpp')
-rw-r--r--core/src/fpdfapi/fpdf_parser/fpdf_parser_document.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/core/src/fpdfapi/fpdf_parser/fpdf_parser_document.cpp b/core/src/fpdfapi/fpdf_parser/fpdf_parser_document.cpp
index 29c1a007cf..2dff766187 100644
--- a/core/src/fpdfapi/fpdf_parser/fpdf_parser_document.cpp
+++ b/core/src/fpdfapi/fpdf_parser/fpdf_parser_document.cpp
@@ -143,15 +143,18 @@ CPDF_Dictionary* CPDF_Document::GetPage(int iPage) {
return nullptr;
if (m_bLinearized && (iPage == (int)m_dwFirstPageNo)) {
- if (CPDF_Dictionary* pDict =
- ToDictionary(GetIndirectObject(m_dwFirstPageObjNum)))
- return pDict;
+ CPDF_Object* pObj = GetIndirectObject(m_dwFirstPageObjNum);
+ if (pObj && pObj->GetType() == PDFOBJ_DICTIONARY) {
+ return static_cast<CPDF_Dictionary*>(pObj);
+ }
}
int objnum = m_PageList.GetAt(iPage);
if (objnum) {
- if (CPDF_Dictionary* pDict = ToDictionary(GetIndirectObject(objnum)))
- return pDict;
+ CPDF_Object* pObj = GetIndirectObject(objnum);
+ if (pObj && pObj->GetType() == PDFOBJ_DICTIONARY) {
+ return static_cast<CPDF_Dictionary*>(pObj);
+ }
}
CPDF_Dictionary* pRoot = GetRoot();