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

Unified Diff: core/fpdfdoc/cpdf_annotlist.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 | « core/fpdfdoc/cpdf_annot.cpp ('k') | core/fpdfdoc/cpdf_apsettings.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fpdfdoc/cpdf_annotlist.cpp
diff --git a/core/fpdfdoc/cpdf_annotlist.cpp b/core/fpdfdoc/cpdf_annotlist.cpp
index 31c8542daaf34f8fc9639694f4be3572762a3616..8ab99e55d257242068bcb6599f6563eba48d46d5 100644
--- a/core/fpdfdoc/cpdf_annotlist.cpp
+++ b/core/fpdfdoc/cpdf_annotlist.cpp
@@ -26,23 +26,23 @@ std::unique_ptr<CPDF_Annot> CreatePopupAnnot(CPDF_Annot* pAnnot,
// TODO(jaepark): We shouldn't strip BOM for some strings and not for others.
// See pdfium:593.
- CFX_WideString sContents = pParentDict->GetUnicodeTextBy("Contents");
+ CFX_WideString sContents = pParentDict->GetUnicodeTextFor("Contents");
if (sContents.IsEmpty())
return std::unique_ptr<CPDF_Annot>();
CPDF_Dictionary* pAnnotDict = new CPDF_Dictionary;
- pAnnotDict->SetAtName("Type", "Annot");
- pAnnotDict->SetAtName("Subtype", "Popup");
- pAnnotDict->SetAtString("T", pParentDict->GetStringBy("T"));
- pAnnotDict->SetAtString("Contents", sContents.UTF8Encode());
+ pAnnotDict->SetNameFor("Type", "Annot");
+ pAnnotDict->SetNameFor("Subtype", "Popup");
+ pAnnotDict->SetStringFor("T", pParentDict->GetStringFor("T"));
+ pAnnotDict->SetStringFor("Contents", sContents.UTF8Encode());
- CFX_FloatRect rect = pParentDict->GetRectBy("Rect");
+ CFX_FloatRect rect = pParentDict->GetRectFor("Rect");
rect.Normalize();
CFX_FloatRect popupRect(0, 0, 200, 200);
popupRect.Translate(rect.left, rect.bottom - popupRect.Height());
- pAnnotDict->SetAtRect("Rect", popupRect);
- pAnnotDict->SetAtInteger("F", 0);
+ pAnnotDict->SetRectFor("Rect", popupRect);
+ pAnnotDict->SetIntegerFor("F", 0);
std::unique_ptr<CPDF_Annot> pPopupAnnot(
new CPDF_Annot(pAnnotDict, pDocument, true));
@@ -57,14 +57,14 @@ CPDF_AnnotList::CPDF_AnnotList(CPDF_Page* pPage)
if (!pPage->m_pFormDict)
return;
- CPDF_Array* pAnnots = pPage->m_pFormDict->GetArrayBy("Annots");
+ CPDF_Array* pAnnots = pPage->m_pFormDict->GetArrayFor("Annots");
if (!pAnnots)
return;
CPDF_Dictionary* pRoot = m_pDocument->GetRoot();
- CPDF_Dictionary* pAcroForm = pRoot->GetDictBy("AcroForm");
+ CPDF_Dictionary* pAcroForm = pRoot->GetDictFor("AcroForm");
FX_BOOL bRegenerateAP =
- pAcroForm && pAcroForm->GetBooleanBy("NeedAppearances");
+ pAcroForm && pAcroForm->GetBooleanFor("NeedAppearances");
for (size_t i = 0; i < pAnnots->GetCount(); ++i) {
CPDF_Dictionary* pDict = ToDictionary(pAnnots->GetDirectObjectAt(i));
if (!pDict)
@@ -81,12 +81,12 @@ CPDF_AnnotList::CPDF_AnnotList(CPDF_Page* pPage)
// Skip creating Popup annotation in the PDF document since PDFium provides
// its own Popup annotations.
- if (pDict->GetStringBy("Subtype") == "Popup")
+ if (pDict->GetStringFor("Subtype") == "Popup")
continue;
m_AnnotList.push_back(
std::unique_ptr<CPDF_Annot>(new CPDF_Annot(pDict, m_pDocument, false)));
- if (bRegenerateAP && pDict->GetStringBy("Subtype") == "Widget" &&
+ if (bRegenerateAP && pDict->GetStringFor("Subtype") == "Widget" &&
CPDF_InterForm::IsUpdateAPEnabled()) {
FPDF_GenerateAP(m_pDocument, pDict);
}
@@ -130,7 +130,7 @@ void CPDF_AnnotList::DisplayPass(CPDF_Page* pPage,
CPDF_OCContext* pOCContext = pOptions->m_pOCContext;
CPDF_Dictionary* pAnnotDict = pAnnot->GetAnnotDict();
if (pOCContext && pAnnotDict &&
- !pOCContext->CheckOCGVisible(pAnnotDict->GetDictBy("OC"))) {
+ !pOCContext->CheckOCGVisible(pAnnotDict->GetDictFor("OC"))) {
continue;
}
}
« no previous file with comments | « core/fpdfdoc/cpdf_annot.cpp ('k') | core/fpdfdoc/cpdf_apsettings.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698