diff options
author | tsepez <tsepez@chromium.org> | 2016-03-29 14:51:50 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-03-29 14:51:50 -0700 |
commit | bd56755ba86f2d87e24a3cee5cb92aa14a81bb27 (patch) | |
tree | fb4692dc44cb549b7149be080ec26f4b7cd7b086 /core/fpdfapi/fpdf_edit | |
parent | 7f432a1c87014d6673ee69ff0ffa3724f237acf4 (diff) | |
download | pdfium-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/fpdfapi/fpdf_edit')
-rw-r--r-- | core/fpdfapi/fpdf_edit/cpdf_pagecontentgenerator.cpp | 6 | ||||
-rw-r--r-- | core/fpdfapi/fpdf_edit/fpdf_edit_create.cpp | 12 |
2 files changed, 9 insertions, 9 deletions
diff --git a/core/fpdfapi/fpdf_edit/cpdf_pagecontentgenerator.cpp b/core/fpdfapi/fpdf_edit/cpdf_pagecontentgenerator.cpp index 5f53afd210..6c5339128b 100644 --- a/core/fpdfapi/fpdf_edit/cpdf_pagecontentgenerator.cpp +++ b/core/fpdfapi/fpdf_edit/cpdf_pagecontentgenerator.cpp @@ -47,7 +47,7 @@ void CPDF_PageContentGenerator::GenerateContent() { ProcessImage(buf, pPageObj->AsImage()); } CPDF_Object* pContent = - pPageDict ? pPageDict->GetElementValue("Contents") : NULL; + pPageDict ? pPageDict->GetDirectObjectBy("Contents") : NULL; if (pContent) { pPageDict->RemoveAt("Contents"); } @@ -122,7 +122,7 @@ void CPDF_PageContentGenerator::ProcessForm(CFX_ByteTextBuf& buf, } void CPDF_PageContentGenerator::TransformContent(CFX_Matrix& matrix) { CPDF_Dictionary* pDict = m_pPage->m_pFormDict; - CPDF_Object* pContent = pDict ? pDict->GetElementValue("Contents") : NULL; + CPDF_Object* pContent = pDict ? pDict->GetDirectObjectBy("Contents") : NULL; if (!pContent) return; @@ -133,7 +133,7 @@ void CPDF_PageContentGenerator::TransformContent(CFX_Matrix& matrix) { int size = 0; int i = 0; for (i = 0; i < iCount; ++i) { - pContent = pArray->GetElement(i); + pContent = pArray->GetObjectAt(i); CPDF_Stream* pStream = ToStream(pContent); if (!pStream) continue; diff --git a/core/fpdfapi/fpdf_edit/fpdf_edit_create.cpp b/core/fpdfapi/fpdf_edit/fpdf_edit_create.cpp index 7dc90601c4..0f087d980a 100644 --- a/core/fpdfapi/fpdf_edit/fpdf_edit_create.cpp +++ b/core/fpdfapi/fpdf_edit/fpdf_edit_create.cpp @@ -96,7 +96,7 @@ int32_t PDF_CreatorAppendObject(const CPDF_Object* pObj, offset += 1; const CPDF_Array* p = pObj->AsArray(); for (uint32_t i = 0; i < p->GetCount(); i++) { - CPDF_Object* pElement = p->GetElement(i); + CPDF_Object* pElement = p->GetObjectAt(i); if (pElement->GetObjNum()) { if (pFile->AppendString(" ") < 0) { return -1; @@ -1199,7 +1199,7 @@ int32_t CPDF_Creator::WriteDirectObj(uint32_t objnum, m_Offset += 1; const CPDF_Array* p = pObj->AsArray(); for (uint32_t i = 0; i < p->GetCount(); i++) { - CPDF_Object* pElement = p->GetElement(i); + CPDF_Object* pElement = p->GetObjectAt(i); if (pElement->GetObjNum()) { if (m_File.AppendString(" ") < 0) { return -1; @@ -1493,7 +1493,7 @@ int32_t CPDF_Creator::WriteDoc_Stage1(IFX_Pause* pPause) { m_dwFlags &= ~FPDFCREATE_INCREMENTAL; } CPDF_Dictionary* pDict = m_pDocument->GetRoot(); - m_pMetadata = pDict ? pDict->GetElementValue("Metadata") : NULL; + m_pMetadata = pDict ? pDict->GetDirectObjectBy("Metadata") : NULL; if (m_dwFlags & FPDFCREATE_OBJECTSTREAM) { m_pXRefStream = new CPDF_XRefStream; m_pXRefStream->Start(); @@ -1979,7 +1979,7 @@ void CPDF_Creator::InitID(FX_BOOL bDefault) { FX_BOOL bNewId = !m_pIDArray; if (!m_pIDArray) { m_pIDArray = new CPDF_Array; - CPDF_Object* pID1 = pOldIDArray ? pOldIDArray->GetElement(0) : NULL; + CPDF_Object* pID1 = pOldIDArray ? pOldIDArray->GetObjectAt(0) : NULL; if (pID1) { m_pIDArray->Add(pID1->Clone()); } else { @@ -1993,7 +1993,7 @@ void CPDF_Creator::InitID(FX_BOOL bDefault) { return; } if (pOldIDArray) { - CPDF_Object* pID2 = pOldIDArray->GetElement(1); + CPDF_Object* pID2 = pOldIDArray->GetObjectAt(1); if ((m_dwFlags & FPDFCREATE_INCREMENTAL) && m_pEncryptDict && pID2) { m_pIDArray->Add(pID2->Clone()); return; @@ -2004,7 +2004,7 @@ void CPDF_Creator::InitID(FX_BOOL bDefault) { m_pIDArray->Add(new CPDF_String(bsBuffer, TRUE), m_pDocument); return; } - m_pIDArray->Add(m_pIDArray->GetElement(0)->Clone()); + m_pIDArray->Add(m_pIDArray->GetObjectAt(0)->Clone()); if (m_pEncryptDict && !pOldIDArray && m_pParser && bNewId) { if (m_pEncryptDict->GetStringBy("Filter") == "Standard") { CPDF_StandardSecurityHandler handler; |