diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2015-10-22 16:45:48 -0400 |
---|---|---|
committer | Dan Sinclair <dsinclair@chromium.org> | 2015-10-22 16:45:48 -0400 |
commit | aa435ba7fe0aacd9102e8c73311c5382ca112439 (patch) | |
tree | d37573646c6135126d3971358024a70ee222fb21 /core/src/fpdfdoc/doc_tagged.cpp | |
parent | 2b11dc1220746d2f6f97a940fc9e4235c8ed4975 (diff) | |
download | pdfium-aa435ba7fe0aacd9102e8c73311c5382ca112439.tar.xz |
Merge to XFA: Add type cast definitions for CPDF_Stream.
This Cl adds ToStream, CPDF_Object::AsStream and CPDF_Object::IsStream and
updates the src to use them as needed.
BUG=pdfium:201
R=tsepez@chromium.org
Review URL: https://codereview.chromium.org/1402413004 .
(cherry picked from commit 338805f1366dcdf9a5b48cf591541cf98d7490f1)
Review URL: https://codereview.chromium.org/1422513004 .
Diffstat (limited to 'core/src/fpdfdoc/doc_tagged.cpp')
-rw-r--r-- | core/src/fpdfdoc/doc_tagged.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/core/src/fpdfdoc/doc_tagged.cpp b/core/src/fpdfdoc/doc_tagged.cpp index 2b20e07bb8..f74aa7f6f5 100644 --- a/core/src/fpdfdoc/doc_tagged.cpp +++ b/core/src/fpdfdoc/doc_tagged.cpp @@ -317,8 +317,8 @@ static CPDF_Dictionary* FindAttrDict(CPDF_Object* pAttrs, CPDF_Dictionary* pDict = nullptr; if (pAttrs->IsDictionary()) { pDict = pAttrs->AsDictionary(); - } else if (pAttrs->GetType() == PDFOBJ_STREAM) { - pDict = ((CPDF_Stream*)pAttrs)->GetDict(); + } else if (CPDF_Stream* pStream = pAttrs->AsStream()) { + pDict = pStream->GetDict(); } else if (CPDF_Array* pArray = pAttrs->AsArray()) { for (FX_DWORD i = 0; i < pArray->GetCount(); i++) { CPDF_Object* pElement = pArray->GetElementValue(i); @@ -327,10 +327,9 @@ static CPDF_Dictionary* FindAttrDict(CPDF_Object* pAttrs, return pDict; } } - if (pDict && pDict->GetString(FX_BSTRC("O")) == owner) { + if (pDict && pDict->GetString(FX_BSTRC("O")) == owner) return pDict; - } - return NULL; + return nullptr; } CPDF_Object* CPDF_StructElementImpl::GetAttr(const CFX_ByteStringC& owner, const CFX_ByteStringC& name, |