diff options
author | tsepez <tsepez@chromium.org> | 2016-04-04 16:41:35 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-04-04 16:41:35 -0700 |
commit | 28f97ff783c16f3391384ce97b765ce4eb310ac7 (patch) | |
tree | 69c4c8bc9dd39d5336c96f28b633d197dd207c81 /core/fpdfdoc/doc_tagged.cpp | |
parent | ed9c4386713084f37548b46ab36f618021f716f5 (diff) | |
download | pdfium-28f97ff783c16f3391384ce97b765ce4eb310ac7.tar.xz |
Make down-conversion explicit from CFX_ByteString to CFX_ByteStringC.
Having this happen implicitly can be dangerous because the lifetime
has to be considered; we should have caught the "red bots" in
https://codereview.chromium.org/1847333004/#ps60001 at compile time.
Review URL: https://codereview.chromium.org/1853233002
Diffstat (limited to 'core/fpdfdoc/doc_tagged.cpp')
-rw-r--r-- | core/fpdfdoc/doc_tagged.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/core/fpdfdoc/doc_tagged.cpp b/core/fpdfdoc/doc_tagged.cpp index 684789acc2..2a3554c499 100644 --- a/core/fpdfdoc/doc_tagged.cpp +++ b/core/fpdfdoc/doc_tagged.cpp @@ -205,7 +205,8 @@ CPDF_StructElementImpl::CPDF_StructElementImpl(CPDF_StructTreeImpl* pTree, m_pDict = pDict; m_Type = pDict->GetStringBy("S"); if (pTree->m_pRoleMap) { - CFX_ByteString mapped = pTree->m_pRoleMap->GetStringBy(m_Type); + CFX_ByteString mapped = + pTree->m_pRoleMap->GetStringBy(m_Type.AsByteStringC()); if (!mapped.IsEmpty()) { m_Type = mapped; } @@ -373,14 +374,16 @@ CPDF_Object* CPDF_StructElementImpl::GetAttr(const CFX_ByteStringC& owner, if (CPDF_Array* pArray = pC->AsArray()) { for (uint32_t i = 0; i < pArray->GetCount(); i++) { CFX_ByteString class_name = pArray->GetStringAt(i); - CPDF_Dictionary* pClassDict = pClassMap->GetDictBy(class_name); + CPDF_Dictionary* pClassDict = + pClassMap->GetDictBy(class_name.AsByteStringC()); if (pClassDict && pClassDict->GetStringBy("O") == owner) return pClassDict->GetDirectObjectBy(name); } return nullptr; } CFX_ByteString class_name = pC->GetString(); - CPDF_Dictionary* pClassDict = pClassMap->GetDictBy(class_name); + CPDF_Dictionary* pClassDict = + pClassMap->GetDictBy(class_name.AsByteStringC()); if (pClassDict && pClassDict->GetStringBy("O") == owner) return pClassDict->GetDirectObjectBy(name); return nullptr; |