summaryrefslogtreecommitdiff
path: root/core/src/fpdfdoc/doc_tagged.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/fpdfdoc/doc_tagged.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/fpdfdoc/doc_tagged.cpp')
-rw-r--r--core/src/fpdfdoc/doc_tagged.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/core/src/fpdfdoc/doc_tagged.cpp b/core/src/fpdfdoc/doc_tagged.cpp
index fb3a05d59f..facad46886 100644
--- a/core/src/fpdfdoc/doc_tagged.cpp
+++ b/core/src/fpdfdoc/doc_tagged.cpp
@@ -54,9 +54,9 @@ void CPDF_StructTreeImpl::LoadDocTree() {
if (pKids == NULL) {
return;
}
- if (CPDF_Dictionary* pDict = pKids->AsDictionary()) {
+ if (pKids->GetType() == PDFOBJ_DICTIONARY) {
CPDF_StructElementImpl* pStructElementImpl =
- new CPDF_StructElementImpl(this, NULL, pDict);
+ new CPDF_StructElementImpl(this, NULL, (CPDF_Dictionary*)pKids);
m_Kids.Add(pStructElementImpl);
return;
}
@@ -81,7 +81,7 @@ void CPDF_StructTreeImpl::LoadPageTree(const CPDF_Dictionary* pPageDict) {
return;
}
FX_DWORD dwKids = 0;
- if (pKids->IsDictionary()) {
+ if (pKids->GetType() == PDFOBJ_DICTIONARY) {
dwKids = 1;
} else if (pKids->GetType() == PDFOBJ_ARRAY) {
dwKids = ((CPDF_Array*)pKids)->GetCount();
@@ -161,7 +161,7 @@ FX_BOOL CPDF_StructTreeImpl::AddTopLevelNode(CPDF_Dictionary* pDict,
if (!pObj) {
return FALSE;
}
- if (pObj->IsDictionary()) {
+ if (pObj->GetType() == PDFOBJ_DICTIONARY) {
if (pObj->GetObjNum() == pDict->GetObjNum()) {
if (m_Kids[0]) {
m_Kids[0]->Release();
@@ -266,10 +266,10 @@ void CPDF_StructElementImpl::LoadKid(FX_DWORD PageObjNum,
pKid->m_PageContent.m_PageObjNum = PageObjNum;
return;
}
- CPDF_Dictionary* pKidDict = pKidObj->AsDictionary();
- if (!pKidDict)
+ if (pKidObj->GetType() != PDFOBJ_DICTIONARY) {
return;
-
+ }
+ CPDF_Dictionary* pKidDict = (CPDF_Dictionary*)pKidObj;
CPDF_Object* pPageObj = pKidDict->GetElement(FX_BSTRC("Pg"));
if (pPageObj && pPageObj->GetType() == PDFOBJ_REFERENCE) {
PageObjNum = ((CPDF_Reference*)pPageObj)->GetRefObjNum();
@@ -322,8 +322,8 @@ static CPDF_Dictionary* FindAttrDict(CPDF_Object* pAttrs,
return NULL;
}
CPDF_Dictionary* pDict = NULL;
- if (pAttrs->IsDictionary()) {
- pDict = pAttrs->AsDictionary();
+ if (pAttrs->GetType() == PDFOBJ_DICTIONARY) {
+ pDict = (CPDF_Dictionary*)pAttrs;
} else if (pAttrs->GetType() == PDFOBJ_STREAM) {
pDict = ((CPDF_Stream*)pAttrs)->GetDict();
} else if (pAttrs->GetType() == PDFOBJ_ARRAY) {