summaryrefslogtreecommitdiff
path: root/core/fpdfdoc
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-03-29 14:51:50 -0700
committerCommit bot <commit-bot@chromium.org>2016-03-29 14:51:50 -0700
commitbd56755ba86f2d87e24a3cee5cb92aa14a81bb27 (patch)
treefb4692dc44cb549b7149be080ec26f4b7cd7b086 /core/fpdfdoc
parent7f432a1c87014d6673ee69ff0ffa3724f237acf4 (diff)
downloadpdfium-bd56755ba86f2d87e24a3cee5cb92aa14a81bb27.tar.xz
Rename GetElementValue() to GetDirectObject{By,At}().
Every time I read this code, I have to make the mental substituion that "Element value" means "de-ref indirect object", so it might as well just say so. BUG= Review URL: https://codereview.chromium.org/1841173002
Diffstat (limited to 'core/fpdfdoc')
-rw-r--r--core/fpdfdoc/doc_action.cpp20
-rw-r--r--core/fpdfdoc/doc_annot.cpp6
-rw-r--r--core/fpdfdoc/doc_ap.cpp4
-rw-r--r--core/fpdfdoc/doc_basic.cpp12
-rw-r--r--core/fpdfdoc/doc_bookmark.cpp4
-rw-r--r--core/fpdfdoc/doc_form.cpp12
-rw-r--r--core/fpdfdoc/doc_formfield.cpp10
-rw-r--r--core/fpdfdoc/doc_link.cpp2
-rw-r--r--core/fpdfdoc/doc_ocg.cpp8
-rw-r--r--core/fpdfdoc/doc_tagged.cpp34
-rw-r--r--core/fpdfdoc/doc_utils.cpp4
11 files changed, 58 insertions, 58 deletions
diff --git a/core/fpdfdoc/doc_action.cpp b/core/fpdfdoc/doc_action.cpp
index ce37e1e9c9..2f08bfa3af 100644
--- a/core/fpdfdoc/doc_action.cpp
+++ b/core/fpdfdoc/doc_action.cpp
@@ -32,7 +32,7 @@ CPDF_Dest CPDF_Action::GetDest(CPDF_Document* pDoc) const {
if (type != "GoTo" && type != "GoToR") {
return CPDF_Dest();
}
- CPDF_Object* pDest = m_pDict->GetElementValue("D");
+ CPDF_Object* pDest = m_pDict->GetDirectObjectBy("D");
if (!pDest) {
return CPDF_Dest();
}
@@ -67,7 +67,7 @@ CFX_WideString CPDF_Action::GetFilePath() const {
type != "ImportData") {
return CFX_WideString();
}
- CPDF_Object* pFile = m_pDict->GetElementValue("F");
+ CPDF_Object* pFile = m_pDict->GetDirectObjectBy("F");
CFX_WideString path;
if (!pFile) {
if (type == "Launch") {
@@ -111,7 +111,7 @@ uint32_t CPDF_ActionFields::GetFieldsCount() const {
CFX_ByteString csType = pDict->GetStringBy("S");
CPDF_Object* pFields = NULL;
if (csType == "Hide") {
- pFields = pDict->GetElementValue("T");
+ pFields = pDict->GetDirectObjectBy("T");
} else {
pFields = pDict->GetArrayBy("Fields");
}
@@ -138,7 +138,7 @@ std::vector<CPDF_Object*> CPDF_ActionFields::GetAllFields() const {
CFX_ByteString csType = pDict->GetStringBy("S");
CPDF_Object* pFields;
if (csType == "Hide")
- pFields = pDict->GetElementValue("T");
+ pFields = pDict->GetDirectObjectBy("T");
else
pFields = pDict->GetArrayBy("Fields");
if (!pFields)
@@ -149,7 +149,7 @@ std::vector<CPDF_Object*> CPDF_ActionFields::GetAllFields() const {
} else if (CPDF_Array* pArray = pFields->AsArray()) {
uint32_t iCount = pArray->GetCount();
for (uint32_t i = 0; i < iCount; ++i) {
- CPDF_Object* pObj = pArray->GetElementValue(i);
+ CPDF_Object* pObj = pArray->GetDirectObjectAt(i);
if (pObj) {
fields.push_back(pObj);
}
@@ -169,7 +169,7 @@ CPDF_Object* CPDF_ActionFields::GetField(uint32_t iIndex) const {
CFX_ByteString csType = pDict->GetStringBy("S");
CPDF_Object* pFields = NULL;
if (csType == "Hide") {
- pFields = pDict->GetElementValue("T");
+ pFields = pDict->GetDirectObjectBy("T");
} else {
pFields = pDict->GetArrayBy("Fields");
}
@@ -181,7 +181,7 @@ CPDF_Object* CPDF_ActionFields::GetField(uint32_t iIndex) const {
if (iIndex == 0)
pFindObj = pFields;
} else if (CPDF_Array* pArray = pFields->AsArray()) {
- pFindObj = pArray->GetElementValue(iIndex);
+ pFindObj = pArray->GetDirectObjectAt(iIndex);
}
return pFindObj;
}
@@ -191,7 +191,7 @@ CFX_WideString CPDF_Action::GetJavaScript() const {
if (!m_pDict) {
return csJS;
}
- CPDF_Object* pJS = m_pDict->GetElementValue("JS");
+ CPDF_Object* pJS = m_pDict->GetDirectObjectBy("JS");
return pJS ? pJS->GetUnicodeText() : csJS;
}
CPDF_Dictionary* CPDF_Action::GetAnnot() const {
@@ -236,7 +236,7 @@ uint32_t CPDF_Action::GetSubActionsCount() const {
if (!m_pDict || !m_pDict->KeyExist("Next"))
return 0;
- CPDF_Object* pNext = m_pDict->GetElementValue("Next");
+ CPDF_Object* pNext = m_pDict->GetDirectObjectBy("Next");
if (!pNext)
return 0;
if (pNext->IsDictionary())
@@ -249,7 +249,7 @@ CPDF_Action CPDF_Action::GetSubAction(uint32_t iIndex) const {
if (!m_pDict || !m_pDict->KeyExist("Next")) {
return CPDF_Action();
}
- CPDF_Object* pNext = m_pDict->GetElementValue("Next");
+ CPDF_Object* pNext = m_pDict->GetDirectObjectBy("Next");
if (CPDF_Dictionary* pDict = ToDictionary(pNext)) {
if (iIndex == 0)
return CPDF_Action(pDict);
diff --git a/core/fpdfdoc/doc_annot.cpp b/core/fpdfdoc/doc_annot.cpp
index e6e441f237..1ea6c8b5a8 100644
--- a/core/fpdfdoc/doc_annot.cpp
+++ b/core/fpdfdoc/doc_annot.cpp
@@ -29,7 +29,7 @@ CPDF_AnnotList::CPDF_AnnotList(CPDF_Page* pPage)
FX_BOOL bRegenerateAP =
pAcroForm && pAcroForm->GetBooleanBy("NeedAppearances");
for (uint32_t i = 0; i < pAnnots->GetCount(); ++i) {
- CPDF_Dictionary* pDict = ToDictionary(pAnnots->GetElementValue(i));
+ CPDF_Dictionary* pDict = ToDictionary(pAnnots->GetDirectObjectAt(i));
if (!pDict)
continue;
@@ -166,7 +166,7 @@ CPDF_Stream* FPDFDOC_GetAnnotAP(CPDF_Dictionary* pAnnotDict,
if (!pAP->KeyExist(ap_entry))
ap_entry = "N";
- CPDF_Object* psub = pAP->GetElementValue(ap_entry);
+ CPDF_Object* psub = pAP->GetDirectObjectBy(ap_entry);
if (!psub)
return nullptr;
if (CPDF_Stream* pStream = psub->AsStream())
@@ -288,7 +288,7 @@ void CPDF_Annot::DrawBorder(CFX_RenderDevice* pDevice,
int nLen = pDashArray->GetCount();
int i = 0;
for (; i < nLen; ++i) {
- CPDF_Object* pObj = pDashArray->GetElementValue(i);
+ CPDF_Object* pObj = pDashArray->GetDirectObjectAt(i);
if (pObj && pObj->GetInteger()) {
break;
}
diff --git a/core/fpdfdoc/doc_ap.cpp b/core/fpdfdoc/doc_ap.cpp
index 87edcd9836..e87b21b8ec 100644
--- a/core/fpdfdoc/doc_ap.cpp
+++ b/core/fpdfdoc/doc_ap.cpp
@@ -616,12 +616,12 @@ static FX_BOOL GenerateWidgetAP(CPDF_Document* pDoc,
if (IsFloatSmaller(fy, rcBody.bottom)) {
break;
}
- if (CPDF_Object* pOpt = pOpts->GetElementValue(i)) {
+ if (CPDF_Object* pOpt = pOpts->GetDirectObjectAt(i)) {
CFX_WideString swItem;
if (pOpt->IsString())
swItem = pOpt->GetUnicodeText();
else if (CPDF_Array* pArray = pOpt->AsArray())
- swItem = pArray->GetElementValue(1)->GetUnicodeText();
+ swItem = pArray->GetDirectObjectAt(1)->GetUnicodeText();
FX_BOOL bSelected = FALSE;
if (pSels) {
diff --git a/core/fpdfdoc/doc_basic.cpp b/core/fpdfdoc/doc_basic.cpp
index 08d07e6c66..c711709e73 100644
--- a/core/fpdfdoc/doc_basic.cpp
+++ b/core/fpdfdoc/doc_basic.cpp
@@ -22,7 +22,7 @@ int CPDF_Dest::GetPageIndex(CPDF_Document* pDoc) {
if (!pArray)
return 0;
- CPDF_Object* pPage = pArray->GetElementValue(0);
+ CPDF_Object* pPage = pArray->GetDirectObjectAt(0);
if (!pPage)
return 0;
if (pPage->IsNumber())
@@ -36,7 +36,7 @@ uint32_t CPDF_Dest::GetPageObjNum() {
if (!pArray)
return 0;
- CPDF_Object* pPage = pArray->GetElementValue(0);
+ CPDF_Object* pPage = pArray->GetDirectObjectAt(0);
if (!pPage)
return 0;
if (pPage->IsNumber())
@@ -51,7 +51,7 @@ int CPDF_Dest::GetZoomMode() {
if (!pArray)
return 0;
- CPDF_Object* pObj = pArray->GetElementValue(1);
+ CPDF_Object* pObj = pArray->GetDirectObjectAt(1);
if (!pObj)
return 0;
@@ -116,7 +116,7 @@ static CPDF_Object* SearchNameNode(CPDF_Dictionary* pNode,
break;
}
nIndex += i;
- return pNames->GetElementValue(i * 2 + 1);
+ return pNames->GetDirectObjectAt(i * 2 + 1);
}
nIndex += dwCount;
return NULL;
@@ -158,7 +158,7 @@ static CPDF_Object* SearchNameNode(CPDF_Dictionary* pNode,
*ppFind = pNames;
}
csName = pNames->GetStringAt((nIndex - nCurIndex) * 2);
- return pNames->GetElementValue((nIndex - nCurIndex) * 2 + 1);
+ return pNames->GetDirectObjectAt((nIndex - nCurIndex) * 2 + 1);
}
CPDF_Array* pKids = pNode->GetArrayBy("Kids");
if (!pKids) {
@@ -237,7 +237,7 @@ CPDF_Array* CPDF_NameTree::LookupNamedDest(CPDF_Document* pDoc,
CPDF_Dictionary* pDests = pDoc->GetRoot()->GetDictBy("Dests");
if (!pDests)
return nullptr;
- pValue = pDests->GetElementValue(sName);
+ pValue = pDests->GetDirectObjectBy(sName);
}
if (!pValue)
return nullptr;
diff --git a/core/fpdfdoc/doc_bookmark.cpp b/core/fpdfdoc/doc_bookmark.cpp
index 0ad7b5b70d..22ff7921ef 100644
--- a/core/fpdfdoc/doc_bookmark.cpp
+++ b/core/fpdfdoc/doc_bookmark.cpp
@@ -55,7 +55,7 @@ CFX_WideString CPDF_Bookmark::GetTitle() const {
if (!m_pDict) {
return CFX_WideString();
}
- CPDF_String* pString = ToString(m_pDict->GetElementValue("Title"));
+ CPDF_String* pString = ToString(m_pDict->GetDirectObjectBy("Title"));
if (!pString)
return CFX_WideString();
@@ -75,7 +75,7 @@ CPDF_Dest CPDF_Bookmark::GetDest(CPDF_Document* pDocument) const {
if (!m_pDict)
return CPDF_Dest();
- CPDF_Object* pDest = m_pDict->GetElementValue("Dest");
+ CPDF_Object* pDest = m_pDict->GetDirectObjectBy("Dest");
if (!pDest)
return CPDF_Dest();
if (pDest->IsString() || pDest->IsName()) {
diff --git a/core/fpdfdoc/doc_form.cpp b/core/fpdfdoc/doc_form.cpp
index 7642fac6bf..2a6d739549 100644
--- a/core/fpdfdoc/doc_form.cpp
+++ b/core/fpdfdoc/doc_form.cpp
@@ -756,7 +756,7 @@ CPDF_FormField* CPDF_InterForm::GetFieldInCalculationOrder(int index) {
return NULL;
}
if (CPDF_Dictionary* pElement =
- ToDictionary(pArray->GetElementValue(index))) {
+ ToDictionary(pArray->GetDirectObjectAt(index))) {
return GetFieldByDict(pElement);
}
return NULL;
@@ -770,7 +770,7 @@ int CPDF_InterForm::FindFieldInCalculationOrder(const CPDF_FormField* pField) {
return -1;
}
for (uint32_t i = 0; i < pArray->GetCount(); i++) {
- CPDF_Object* pElement = pArray->GetElementValue(i);
+ CPDF_Object* pElement = pArray->GetDirectObjectAt(i);
if (pElement == pField->m_pDict) {
return i;
}
@@ -953,20 +953,20 @@ CPDF_FormField* CPDF_InterForm::AddTerminalField(CPDF_Dictionary* pFieldDict) {
}
if (pParent && pParent != pFieldDict && !pParent->KeyExist("FT")) {
if (pFieldDict->KeyExist("FT")) {
- CPDF_Object* pFTValue = pFieldDict->GetElementValue("FT");
+ CPDF_Object* pFTValue = pFieldDict->GetDirectObjectBy("FT");
if (pFTValue) {
pParent->SetAt("FT", pFTValue->Clone());
}
}
if (pFieldDict->KeyExist("Ff")) {
- CPDF_Object* pFfValue = pFieldDict->GetElementValue("Ff");
+ CPDF_Object* pFfValue = pFieldDict->GetDirectObjectBy("Ff");
if (pFfValue) {
pParent->SetAt("Ff", pFfValue->Clone());
}
}
}
pField = new CPDF_FormField(this, pParent);
- CPDF_Object* pTObj = pDict->GetElement("T");
+ CPDF_Object* pTObj = pDict->GetObjectBy("T");
if (ToReference(pTObj)) {
CPDF_Object* pClone = pTObj->Clone(TRUE);
if (pClone)
@@ -1157,7 +1157,7 @@ void CPDF_InterForm::FDF_ImportField(CPDF_Dictionary* pFieldDict,
if ((eType == CPDF_FormField::ListBox || eType == CPDF_FormField::ComboBox) &&
pFieldDict->KeyExist("Opt")) {
pField->m_pDict->SetAt("Opt",
- pFieldDict->GetElementValue("Opt")->Clone(TRUE));
+ pFieldDict->GetDirectObjectBy("Opt")->Clone(TRUE));
}
if (bNotify && m_pFormNotify) {
if (iType == FIELDTYPE_CHECKBOX || iType == FIELDTYPE_RADIOBUTTON) {
diff --git a/core/fpdfdoc/doc_formfield.cpp b/core/fpdfdoc/doc_formfield.cpp
index 88d35d8a11..cc34a9d297 100644
--- a/core/fpdfdoc/doc_formfield.cpp
+++ b/core/fpdfdoc/doc_formfield.cpp
@@ -305,7 +305,7 @@ CFX_WideString CPDF_FormField::GetValue(FX_BOOL bDefault) {
case CPDF_Object::STREAM:
return pValue->GetUnicodeText();
case CPDF_Object::ARRAY:
- pValue = pValue->AsArray()->GetElementValue(0);
+ pValue = pValue->AsArray()->GetDirectObjectAt(0);
if (pValue)
return pValue->GetUnicodeText();
break;
@@ -447,7 +447,7 @@ int CPDF_FormField::GetSelectedIndex(int index) {
if (!pArray || index < 0)
return -1;
- CPDF_Object* elementValue = pArray->GetElementValue(index);
+ CPDF_Object* elementValue = pArray->GetDirectObjectAt(index);
sel_value =
elementValue ? elementValue->GetUnicodeText() : CFX_WideString();
}
@@ -538,7 +538,7 @@ FX_BOOL CPDF_FormField::IsItemSelected(int index) {
}
}
for (uint32_t i = 0; i < pArray->GetCount(); i++)
- if (pArray->GetElementValue(i)->GetUnicodeText() == opt_value &&
+ if (pArray->GetDirectObjectAt(i)->GetUnicodeText() == opt_value &&
(int)i == iPos) {
return TRUE;
}
@@ -691,11 +691,11 @@ CFX_WideString CPDF_FormField::GetOptionText(int index, int sub_index) {
if (!pArray)
return CFX_WideString();
- CPDF_Object* pOption = pArray->GetElementValue(index);
+ CPDF_Object* pOption = pArray->GetDirectObjectAt(index);
if (!pOption)
return CFX_WideString();
if (CPDF_Array* pOptionArray = pOption->AsArray())
- pOption = pOptionArray->GetElementValue(sub_index);
+ pOption = pOptionArray->GetDirectObjectAt(sub_index);
CPDF_String* pString = ToString(pOption);
return pString ? pString->GetUnicodeText() : CFX_WideString();
diff --git a/core/fpdfdoc/doc_link.cpp b/core/fpdfdoc/doc_link.cpp
index 3f97024237..723955f9ea 100644
--- a/core/fpdfdoc/doc_link.cpp
+++ b/core/fpdfdoc/doc_link.cpp
@@ -75,7 +75,7 @@ CFX_FloatRect CPDF_Link::GetRect() {
return m_pDict->GetRectBy("Rect");
}
CPDF_Dest CPDF_Link::GetDest(CPDF_Document* pDoc) {
- CPDF_Object* pDest = m_pDict->GetElementValue("Dest");
+ CPDF_Object* pDest = m_pDict->GetDirectObjectBy("Dest");
if (!pDest)
return CPDF_Dest();
diff --git a/core/fpdfdoc/doc_ocg.cpp b/core/fpdfdoc/doc_ocg.cpp
index 43ccc3fd8d..a739c1675c 100644
--- a/core/fpdfdoc/doc_ocg.cpp
+++ b/core/fpdfdoc/doc_ocg.cpp
@@ -26,7 +26,7 @@ static int32_t FPDFDOC_OCG_FindGroup(const CPDF_Object* pObject,
static FX_BOOL FPDFDOC_OCG_HasIntent(const CPDF_Dictionary* pDict,
const CFX_ByteStringC& csElement,
const CFX_ByteStringC& csDef = "") {
- CPDF_Object* pIntent = pDict->GetElementValue("Intent");
+ CPDF_Object* pIntent = pDict->GetDirectObjectBy("Intent");
if (!pIntent) {
return csElement == csDef;
}
@@ -198,7 +198,7 @@ FX_BOOL CPDF_OCContext::GetOCGVE(CPDF_Array* pExpression,
CPDF_Object* pOCGObj;
CFX_ByteString csOperator = pExpression->GetStringAt(0);
if (csOperator == "Not") {
- pOCGObj = pExpression->GetElementValue(1);
+ pOCGObj = pExpression->GetDirectObjectAt(1);
if (!pOCGObj)
return FALSE;
if (CPDF_Dictionary* pDict = pOCGObj->AsDictionary())
@@ -210,7 +210,7 @@ FX_BOOL CPDF_OCContext::GetOCGVE(CPDF_Array* pExpression,
if (csOperator == "Or" || csOperator == "And") {
FX_BOOL bValue = FALSE;
for (int32_t i = 1; i < iCount; i++) {
- pOCGObj = pExpression->GetElementValue(1);
+ pOCGObj = pExpression->GetDirectObjectAt(1);
if (!pOCGObj) {
continue;
}
@@ -241,7 +241,7 @@ FX_BOOL CPDF_OCContext::LoadOCMDState(const CPDF_Dictionary* pOCMDDict,
return GetOCGVE(pVE, bFromConfig);
}
CFX_ByteString csP = pOCMDDict->GetStringBy("P", "AnyOn");
- CPDF_Object* pOCGObj = pOCMDDict->GetElementValue("OCGs");
+ CPDF_Object* pOCGObj = pOCMDDict->GetDirectObjectBy("OCGs");
if (!pOCGObj)
return TRUE;
if (const CPDF_Dictionary* pDict = pOCGObj->AsDictionary())
diff --git a/core/fpdfdoc/doc_tagged.cpp b/core/fpdfdoc/doc_tagged.cpp
index 868031401d..684789acc2 100644
--- a/core/fpdfdoc/doc_tagged.cpp
+++ b/core/fpdfdoc/doc_tagged.cpp
@@ -57,7 +57,7 @@ void CPDF_StructTreeImpl::LoadDocTree() {
if (!m_pTreeRoot)
return;
- CPDF_Object* pKids = m_pTreeRoot->GetElementValue("K");
+ CPDF_Object* pKids = m_pTreeRoot->GetDirectObjectBy("K");
if (!pKids)
return;
if (CPDF_Dictionary* pDict = pKids->AsDictionary()) {
@@ -82,7 +82,7 @@ void CPDF_StructTreeImpl::LoadPageTree(const CPDF_Dictionary* pPageDict) {
if (!m_pTreeRoot)
return;
- CPDF_Object* pKids = m_pTreeRoot->GetElementValue("K");
+ CPDF_Object* pKids = m_pTreeRoot->GetDirectObjectBy("K");
if (!pKids)
return;
@@ -163,7 +163,7 @@ CPDF_StructElementImpl* CPDF_StructTreeImpl::AddPageNode(
}
FX_BOOL CPDF_StructTreeImpl::AddTopLevelNode(CPDF_Dictionary* pDict,
CPDF_StructElementImpl* pElement) {
- CPDF_Object* pObj = m_pTreeRoot->GetElementValue("K");
+ CPDF_Object* pObj = m_pTreeRoot->GetDirectObjectBy("K");
if (!pObj) {
return FALSE;
}
@@ -181,7 +181,7 @@ FX_BOOL CPDF_StructTreeImpl::AddTopLevelNode(CPDF_Dictionary* pDict,
uint32_t i;
FX_BOOL bSave = FALSE;
for (i = 0; i < pTopKids->GetCount(); i++) {
- CPDF_Reference* pKidRef = ToReference(pTopKids->GetElement(i));
+ CPDF_Reference* pKidRef = ToReference(pTopKids->GetObjectAt(i));
if (!pKidRef)
continue;
if (pKidRef->GetRefObjNum() != pDict->GetObjNum())
@@ -231,19 +231,19 @@ void CPDF_StructElementImpl::Release() {
}
}
void CPDF_StructElementImpl::LoadKids(CPDF_Dictionary* pDict) {
- CPDF_Object* pObj = pDict->GetElement("Pg");
+ CPDF_Object* pObj = pDict->GetObjectBy("Pg");
uint32_t PageObjNum = 0;
if (CPDF_Reference* pRef = ToReference(pObj))
PageObjNum = pRef->GetRefObjNum();
- CPDF_Object* pKids = pDict->GetElementValue("K");
+ CPDF_Object* pKids = pDict->GetDirectObjectBy("K");
if (!pKids)
return;
if (CPDF_Array* pArray = pKids->AsArray()) {
m_Kids.SetSize(pArray->GetCount());
for (uint32_t i = 0; i < pArray->GetCount(); i++) {
- CPDF_Object* pKid = pArray->GetElementValue(i);
+ CPDF_Object* pKid = pArray->GetDirectObjectAt(i);
LoadKid(PageObjNum, pKid, &m_Kids[i]);
}
} else {
@@ -272,7 +272,7 @@ void CPDF_StructElementImpl::LoadKid(uint32_t PageObjNum,
if (!pKidDict)
return;
- if (CPDF_Reference* pRef = ToReference(pKidDict->GetElement("Pg")))
+ if (CPDF_Reference* pRef = ToReference(pKidDict->GetObjectBy("Pg")))
PageObjNum = pRef->GetRefObjNum();
CFX_ByteString type = pKidDict->GetStringBy("Type");
@@ -281,7 +281,7 @@ void CPDF_StructElementImpl::LoadKid(uint32_t PageObjNum,
return;
}
pKid->m_Type = CPDF_StructKid::StreamContent;
- if (CPDF_Reference* pRef = ToReference(pKidDict->GetElement("Stm"))) {
+ if (CPDF_Reference* pRef = ToReference(pKidDict->GetObjectBy("Stm"))) {
pKid->m_StreamContent.m_RefObjNum = pRef->GetRefObjNum();
} else {
pKid->m_StreamContent.m_RefObjNum = 0;
@@ -293,7 +293,7 @@ void CPDF_StructElementImpl::LoadKid(uint32_t PageObjNum,
return;
}
pKid->m_Type = CPDF_StructKid::Object;
- if (CPDF_Reference* pObj = ToReference(pKidDict->GetElement("Obj"))) {
+ if (CPDF_Reference* pObj = ToReference(pKidDict->GetObjectBy("Obj"))) {
pKid->m_Object.m_RefObjNum = pObj->GetRefObjNum();
} else {
pKid->m_Object.m_RefObjNum = 0;
@@ -325,7 +325,7 @@ static CPDF_Dictionary* FindAttrDict(CPDF_Object* pAttrs,
pDict = pStream->GetDict();
} else if (CPDF_Array* pArray = pAttrs->AsArray()) {
for (uint32_t i = 0; i < pArray->GetCount(); i++) {
- CPDF_Object* pElement = pArray->GetElementValue(i);
+ CPDF_Object* pElement = pArray->GetDirectObjectAt(i);
pDict = FindAttrDict(pElement, owner, nLevel + 1);
if (pDict)
return pDict;
@@ -352,17 +352,17 @@ CPDF_Object* CPDF_StructElementImpl::GetAttr(const CFX_ByteStringC& owner,
}
return m_pParent->GetAttr(owner, name, TRUE, fLevel + 1);
}
- CPDF_Object* pA = m_pDict->GetElementValue("A");
+ CPDF_Object* pA = m_pDict->GetDirectObjectBy("A");
if (pA) {
CPDF_Dictionary* pAttrDict = FindAttrDict(pA, owner);
if (pAttrDict) {
- CPDF_Object* pAttr = pAttrDict->GetElementValue(name);
+ CPDF_Object* pAttr = pAttrDict->GetDirectObjectBy(name);
if (pAttr) {
return pAttr;
}
}
}
- CPDF_Object* pC = m_pDict->GetElementValue("C");
+ CPDF_Object* pC = m_pDict->GetDirectObjectBy("C");
if (!pC)
return nullptr;
@@ -375,14 +375,14 @@ CPDF_Object* CPDF_StructElementImpl::GetAttr(const CFX_ByteStringC& owner,
CFX_ByteString class_name = pArray->GetStringAt(i);
CPDF_Dictionary* pClassDict = pClassMap->GetDictBy(class_name);
if (pClassDict && pClassDict->GetStringBy("O") == owner)
- return pClassDict->GetElementValue(name);
+ return pClassDict->GetDirectObjectBy(name);
}
return nullptr;
}
CFX_ByteString class_name = pC->GetString();
CPDF_Dictionary* pClassDict = pClassMap->GetDictBy(class_name);
if (pClassDict && pClassDict->GetStringBy("O") == owner)
- return pClassDict->GetElementValue(name);
+ return pClassDict->GetDirectObjectBy(name);
return nullptr;
}
CPDF_Object* CPDF_StructElementImpl::GetAttr(const CFX_ByteStringC& owner,
@@ -396,7 +396,7 @@ CPDF_Object* CPDF_StructElementImpl::GetAttr(const CFX_ByteStringC& owner,
if (subindex >= static_cast<int>(pArray->GetCount()))
return pAttr;
- return pArray->GetElementValue(subindex);
+ return pArray->GetDirectObjectAt(subindex);
}
CFX_ByteString CPDF_StructElementImpl::GetName(
const CFX_ByteStringC& owner,
diff --git a/core/fpdfdoc/doc_utils.cpp b/core/fpdfdoc/doc_utils.cpp
index e2e3e13e8c..f83d001af5 100644
--- a/core/fpdfdoc/doc_utils.cpp
+++ b/core/fpdfdoc/doc_utils.cpp
@@ -31,7 +31,7 @@ CPDF_Object* SearchNumberNode(const CPDF_Dictionary* pNode, int num) {
for (uint32_t i = 0; i < dwCount; i++) {
int index = pNumbers->GetIntegerAt(i * 2);
if (num == index) {
- return pNumbers->GetElementValue(i * 2 + 1);
+ return pNumbers->GetDirectObjectAt(i * 2 + 1);
}
if (index > num) {
break;
@@ -743,7 +743,7 @@ CPDF_Object* FPDF_GetFieldAttr(CPDF_Dictionary* pFieldDict,
if (!pFieldDict) {
return NULL;
}
- CPDF_Object* pAttr = pFieldDict->GetElementValue(name);
+ CPDF_Object* pAttr = pFieldDict->GetDirectObjectBy(name);
if (pAttr) {
return pAttr;
}