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

Unified Diff: core/fpdfdoc/cpdf_annot.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_actionfields.cpp ('k') | core/fpdfdoc/cpdf_annotlist.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fpdfdoc/cpdf_annot.cpp
diff --git a/core/fpdfdoc/cpdf_annot.cpp b/core/fpdfdoc/cpdf_annot.cpp
index 0cc3596a4d015acf1ab099d8cf31ba0315b66ffd..bee96a62ff2f956eaf45de223754b7571526b263 100644
--- a/core/fpdfdoc/cpdf_annot.cpp
+++ b/core/fpdfdoc/cpdf_annot.cpp
@@ -39,7 +39,7 @@ CPDF_Annot::CPDF_Annot(CPDF_Dictionary* pDict,
m_pDocument(pDocument),
m_bOpenState(false),
m_pPopupAnnot(nullptr) {
- m_nSubtype = StringToAnnotSubtype(m_pAnnotDict->GetStringBy("Subtype"));
+ m_nSubtype = StringToAnnotSubtype(m_pAnnotDict->GetStringFor("Subtype"));
GenerateAPIfNeeded();
}
@@ -95,18 +95,18 @@ CFX_FloatRect CPDF_Annot::GetRect() const {
if (!m_pAnnotDict)
return CFX_FloatRect();
- CFX_FloatRect rect = m_pAnnotDict->GetRectBy("Rect");
+ CFX_FloatRect rect = m_pAnnotDict->GetRectFor("Rect");
rect.Normalize();
return rect;
}
uint32_t CPDF_Annot::GetFlags() const {
- return m_pAnnotDict->GetIntegerBy("F");
+ return m_pAnnotDict->GetIntegerFor("F");
}
CPDF_Stream* FPDFDOC_GetAnnotAP(CPDF_Dictionary* pAnnotDict,
CPDF_Annot::AppearanceMode mode) {
- CPDF_Dictionary* pAP = pAnnotDict->GetDictBy("AP");
+ CPDF_Dictionary* pAP = pAnnotDict->GetDictFor("AP");
if (!pAP) {
return nullptr;
}
@@ -118,26 +118,26 @@ CPDF_Stream* FPDFDOC_GetAnnotAP(CPDF_Dictionary* pAnnotDict,
if (!pAP->KeyExist(ap_entry))
ap_entry = "N";
- CPDF_Object* psub = pAP->GetDirectObjectBy(ap_entry);
+ CPDF_Object* psub = pAP->GetDirectObjectFor(ap_entry);
if (!psub)
return nullptr;
if (CPDF_Stream* pStream = psub->AsStream())
return pStream;
if (CPDF_Dictionary* pDict = psub->AsDictionary()) {
- CFX_ByteString as = pAnnotDict->GetStringBy("AS");
+ CFX_ByteString as = pAnnotDict->GetStringFor("AS");
if (as.IsEmpty()) {
- CFX_ByteString value = pAnnotDict->GetStringBy("V");
+ CFX_ByteString value = pAnnotDict->GetStringFor("V");
if (value.IsEmpty()) {
- CPDF_Dictionary* pParentDict = pAnnotDict->GetDictBy("Parent");
- value = pParentDict ? pParentDict->GetStringBy("V") : CFX_ByteString();
+ CPDF_Dictionary* pParentDict = pAnnotDict->GetDictFor("Parent");
+ value = pParentDict ? pParentDict->GetStringFor("V") : CFX_ByteString();
}
if (value.IsEmpty() || !pDict->KeyExist(value))
as = "Off";
else
as = value;
}
- return pDict->GetStreamBy(as);
+ return pDict->GetStreamFor(as);
}
return nullptr;
}
@@ -167,8 +167,8 @@ static CPDF_Form* FPDFDOC_Annot_GetMatrix(const CPDF_Page* pPage,
if (!pForm) {
return nullptr;
}
- CFX_FloatRect form_bbox = pForm->m_pFormDict->GetRectBy("BBox");
- CFX_Matrix form_matrix = pForm->m_pFormDict->GetMatrixBy("Matrix");
+ CFX_FloatRect form_bbox = pForm->m_pFormDict->GetRectFor("BBox");
+ CFX_Matrix form_matrix = pForm->m_pFormDict->GetMatrixFor("Matrix");
form_matrix.TransformRect(form_bbox);
matrix.MatchRect(pAnnot->GetRect(), form_bbox);
matrix.Concat(*pUser2Device);
@@ -177,7 +177,7 @@ static CPDF_Form* FPDFDOC_Annot_GetMatrix(const CPDF_Page* pPage,
// Static.
bool CPDF_Annot::IsAnnotationHidden(CPDF_Dictionary* pAnnotDict) {
- return !!(pAnnotDict->GetIntegerBy("F") & ANNOTFLAG_HIDDEN);
+ return !!(pAnnotDict->GetIntegerFor("F") & ANNOTFLAG_HIDDEN);
}
// Static.
@@ -366,12 +366,12 @@ void CPDF_Annot::DrawBorder(CFX_RenderDevice* pDevice,
if (!bPrinting && (annot_flags & ANNOTFLAG_NOVIEW)) {
return;
}
- CPDF_Dictionary* pBS = m_pAnnotDict->GetDictBy("BS");
+ CPDF_Dictionary* pBS = m_pAnnotDict->GetDictFor("BS");
char style_char;
FX_FLOAT width;
CPDF_Array* pDashArray = nullptr;
if (!pBS) {
- CPDF_Array* pBorderArray = m_pAnnotDict->GetArrayBy("Border");
+ CPDF_Array* pBorderArray = m_pAnnotDict->GetArrayFor("Border");
style_char = 'S';
if (pBorderArray) {
width = pBorderArray->GetNumberAt(2);
@@ -397,15 +397,15 @@ void CPDF_Annot::DrawBorder(CFX_RenderDevice* pDevice,
width = 1;
}
} else {
- CFX_ByteString style = pBS->GetStringBy("S");
- pDashArray = pBS->GetArrayBy("D");
+ CFX_ByteString style = pBS->GetStringFor("S");
+ pDashArray = pBS->GetArrayFor("D");
style_char = style[1];
- width = pBS->GetNumberBy("W");
+ width = pBS->GetNumberFor("W");
}
if (width <= 0) {
return;
}
- CPDF_Array* pColor = m_pAnnotDict->GetArrayBy("C");
+ CPDF_Array* pColor = m_pAnnotDict->GetArrayFor("C");
uint32_t argb = 0xff000000;
if (pColor) {
int R = (int32_t)(pColor->GetNumberAt(0) * 255);
« no previous file with comments | « core/fpdfdoc/cpdf_actionfields.cpp ('k') | core/fpdfdoc/cpdf_annotlist.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698