Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(46)

Unified Diff: core/src/fpdfdoc/doc_tagged.cpp

Issue 1194933003: Make CPDF_Object::GetString() a virtual method. (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: rebase Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: core/src/fpdfdoc/doc_tagged.cpp
diff --git a/core/src/fpdfdoc/doc_tagged.cpp b/core/src/fpdfdoc/doc_tagged.cpp
index e9f0c55e2ba067988e2c76cfc085dd7c9e968456..909d17ca2b2d73b1165538c20de181d508b8d70b 100644
--- a/core/src/fpdfdoc/doc_tagged.cpp
+++ b/core/src/fpdfdoc/doc_tagged.cpp
@@ -131,7 +131,7 @@ CPDF_StructElementImpl* CPDF_StructTreeImpl::AddPageNode(CPDF_Dictionary* pDict,
pElement = new CPDF_StructElementImpl(this, NULL, pDict);
map.SetAt(pDict, pElement);
CPDF_Dictionary* pParent = pDict->GetDict(FX_BSTRC("P"));
- if (pParent == NULL || pParent->GetString(FX_BSTRC("Type")) == FX_BSTRC("StructTreeRoot")) {
+ if (pParent == NULL || pParent->GetStringAt("Type") == "StructTreeRoot") {
if (!AddTopLevelNode(pDict, pElement)) {
pElement->Release();
map.RemoveKey(pDict);
@@ -201,9 +201,9 @@ CPDF_StructElementImpl::CPDF_StructElementImpl(CPDF_StructTreeImpl* pTree, CPDF_
{
m_pTree = pTree;
m_pDict = pDict;
- m_Type = pDict->GetString(FX_BSTRC("S"));
+ m_Type = pDict->GetStringAt("S");
if (pTree->m_pRoleMap) {
- CFX_ByteString mapped = pTree->m_pRoleMap->GetString(m_Type);
+ CFX_ByteString mapped = pTree->m_pRoleMap->GetStringAt(m_Type);
if (!mapped.IsEmpty()) {
m_Type = mapped;
}
@@ -276,7 +276,7 @@ void CPDF_StructElementImpl::LoadKid(FX_DWORD PageObjNum, CPDF_Object* pKidObj,
if (pPageObj && pPageObj->GetType() == PDFOBJ_REFERENCE) {
PageObjNum = ((CPDF_Reference*)pPageObj)->GetRefObjNum();
}
- CFX_ByteString type = pKidDict->GetString(FX_BSTRC("Type"));
+ CFX_ByteString type = pKidDict->GetStringAt("Type");
if (type == FX_BSTRC("MCR")) {
if (m_pTree->m_pPage && m_pTree->m_pPage->GetObjNum() != PageObjNum) {
return;
@@ -335,7 +335,7 @@ static CPDF_Dictionary* FindAttrDict(CPDF_Object* pAttrs, const CFX_ByteStringC&
}
}
}
- if (pDict && pDict->GetString(FX_BSTRC("O")) == owner) {
+ if (pDict && pDict->GetStringAt("O") == owner) {
return pDict;
}
return NULL;
@@ -376,9 +376,9 @@ CPDF_Object* CPDF_StructElementImpl::GetAttr(const CFX_ByteStringC& owner, const
if (pC->GetType() == PDFOBJ_ARRAY) {
CPDF_Array* pArray = (CPDF_Array*)pC;
for (FX_DWORD i = 0; i < pArray->GetCount(); i ++) {
- CFX_ByteString class_name = pArray->GetString(i);
+ CFX_ByteString class_name = pArray->GetStringAt(i);
CPDF_Dictionary* pClassDict = pClassMap->GetDict(class_name);
- if (pClassDict && pClassDict->GetString(FX_BSTRC("O")) == owner) {
+ if (pClassDict && pClassDict->GetStringAt("O") == owner) {
return pClassDict->GetElementValue(name);
}
}
@@ -386,7 +386,7 @@ CPDF_Object* CPDF_StructElementImpl::GetAttr(const CFX_ByteStringC& owner, const
}
CFX_ByteString class_name = pC->GetString();
CPDF_Dictionary* pClassDict = pClassMap->GetDict(class_name);
- if (pClassDict && pClassDict->GetString(FX_BSTRC("O")) == owner) {
+ if (pClassDict && pClassDict->GetStringAt("O") == owner) {
return pClassDict->GetElementValue(name);
}
return NULL;

Powered by Google App Engine
This is Rietveld 408576698