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

Unified Diff: core/fpdfapi/fpdf_edit/cpdf_pagecontentgenerator.cpp

Issue 2334323005: Rename dictionary set and get methods (Closed)
Patch Set: Created 4 years, 3 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
« no previous file with comments | « no previous file | core/fpdfapi/fpdf_edit/fpdf_edit_create.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fpdfapi/fpdf_edit/cpdf_pagecontentgenerator.cpp
diff --git a/core/fpdfapi/fpdf_edit/cpdf_pagecontentgenerator.cpp b/core/fpdfapi/fpdf_edit/cpdf_pagecontentgenerator.cpp
index 0e4bab1ae1fa62cad31f7f080ac5ae4a4d2dd636..d3d55b91b5ec46a6777c65afd2ed95169ce7d66a 100644
--- a/core/fpdfapi/fpdf_edit/cpdf_pagecontentgenerator.cpp
+++ b/core/fpdfapi/fpdf_edit/cpdf_pagecontentgenerator.cpp
@@ -49,14 +49,14 @@ void CPDF_PageContentGenerator::GenerateContent() {
ProcessImage(buf, pPageObj->AsImage());
}
CPDF_Object* pContent =
- pPageDict ? pPageDict->GetDirectObjectBy("Contents") : nullptr;
+ pPageDict ? pPageDict->GetDirectObjectFor("Contents") : nullptr;
if (pContent) {
- pPageDict->RemoveAt("Contents");
+ pPageDict->RemoveFor("Contents");
}
CPDF_Stream* pStream = new CPDF_Stream(nullptr, 0, nullptr);
pStream->SetData(buf.GetBuffer(), buf.GetLength(), FALSE, FALSE);
m_pDocument->AddIndirectObject(pStream);
- pPageDict->SetAtReference("Contents", m_pDocument, pStream->GetObjNum());
+ pPageDict->SetReferenceFor("Contents", m_pDocument, pStream->GetObjNum());
}
CFX_ByteString CPDF_PageContentGenerator::RealizeResource(
@@ -65,12 +65,12 @@ CFX_ByteString CPDF_PageContentGenerator::RealizeResource(
if (!m_pPage->m_pResources) {
m_pPage->m_pResources = new CPDF_Dictionary;
int objnum = m_pDocument->AddIndirectObject(m_pPage->m_pResources);
- m_pPage->m_pFormDict->SetAtReference("Resources", m_pDocument, objnum);
+ m_pPage->m_pFormDict->SetReferenceFor("Resources", m_pDocument, objnum);
}
- CPDF_Dictionary* pResList = m_pPage->m_pResources->GetDictBy(bsType);
+ CPDF_Dictionary* pResList = m_pPage->m_pResources->GetDictFor(bsType);
if (!pResList) {
pResList = new CPDF_Dictionary;
- m_pPage->m_pResources->SetAt(bsType, pResList);
+ m_pPage->m_pResources->SetFor(bsType, pResList);
}
m_pDocument->AddIndirectObject(pResourceObj);
CFX_ByteString name;
@@ -82,7 +82,7 @@ CFX_ByteString CPDF_PageContentGenerator::RealizeResource(
}
idnum++;
}
- pResList->SetAtReference(name, m_pDocument, pResourceObj->GetObjNum());
+ pResList->SetReferenceFor(name, m_pDocument, pResourceObj->GetObjNum());
return name;
}
@@ -114,11 +114,11 @@ void CPDF_PageContentGenerator::ProcessForm(CFX_ByteTextBuf& buf,
}
CPDF_Stream* pStream = new CPDF_Stream(nullptr, 0, nullptr);
CPDF_Dictionary* pFormDict = new CPDF_Dictionary;
- pFormDict->SetAtName("Type", "XObject");
- pFormDict->SetAtName("Subtype", "Form");
+ pFormDict->SetNameFor("Type", "XObject");
+ pFormDict->SetNameFor("Subtype", "Form");
CFX_FloatRect bbox = m_pPage->GetPageBBox();
matrix.TransformRect(bbox);
- pFormDict->SetAtRect("BBox", bbox);
+ pFormDict->SetRectFor("BBox", bbox);
pStream->InitStream(data, size, pFormDict);
buf << "q " << matrix << " cm ";
CFX_ByteString name = RealizeResource(pStream, "XObject");
@@ -127,7 +127,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->GetDirectObjectBy("Contents") : nullptr;
+ pDict ? pDict->GetDirectObjectFor("Contents") : nullptr;
if (!pContent)
return;
@@ -167,6 +167,6 @@ void CPDF_PageContentGenerator::TransformContent(CFX_Matrix& matrix) {
CPDF_Stream* pStream = new CPDF_Stream(nullptr, 0, nullptr);
pStream->SetData(buf.GetBuffer(), buf.GetLength(), FALSE, FALSE);
m_pDocument->AddIndirectObject(pStream);
- m_pPage->m_pFormDict->SetAtReference("Contents", m_pDocument,
- pStream->GetObjNum());
+ m_pPage->m_pFormDict->SetReferenceFor("Contents", m_pDocument,
+ pStream->GetObjNum());
}
« no previous file with comments | « no previous file | core/fpdfapi/fpdf_edit/fpdf_edit_create.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698