diff options
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, |