From 38fd84428a1ea007a043be0b7d9b289e47aa5da0 Mon Sep 17 00:00:00 2001 From: dsinclair Date: Thu, 15 Sep 2016 10:15:32 -0700 Subject: Rename dictionary set and get methods This Cl makes the Get and Set methods consistenly use {G|S}etFor. BUG=pdfium:596 Review-Url: https://codereview.chromium.org/2334323005 --- core/fpdfapi/fpdf_page/fpdf_page_doc.cpp | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'core/fpdfapi/fpdf_page/fpdf_page_doc.cpp') diff --git a/core/fpdfapi/fpdf_page/fpdf_page_doc.cpp b/core/fpdfapi/fpdf_page/fpdf_page_doc.cpp index fa242ffb85..9e586e326f 100644 --- a/core/fpdfapi/fpdf_page/fpdf_page_doc.cpp +++ b/core/fpdfapi/fpdf_page/fpdf_page_doc.cpp @@ -185,11 +185,11 @@ CPDF_Font* CPDF_DocPageData::GetStandardFont(const CFX_ByteString& fontName, } CPDF_Dictionary* pDict = new CPDF_Dictionary; - pDict->SetAtName("Type", "Font"); - pDict->SetAtName("Subtype", "Type1"); - pDict->SetAtName("BaseFont", fontName); + pDict->SetNameFor("Type", "Font"); + pDict->SetNameFor("Subtype", "Type1"); + pDict->SetNameFor("BaseFont", fontName); if (pEncoding) { - pDict->SetAt("Encoding", pEncoding->Realize()); + pDict->SetFor("Encoding", pEncoding->Realize()); } m_pPDFDoc->AddIndirectObject(pDict); CPDF_Font* pFont = CPDF_Font::CreateFontF(m_pPDFDoc, pDict); @@ -241,30 +241,30 @@ CPDF_ColorSpace* CPDF_DocPageData::GetColorSpaceImpl( CFX_ByteString name = pCSObj->GetString(); CPDF_ColorSpace* pCS = CPDF_ColorSpace::ColorspaceFromName(name); if (!pCS && pResources) { - CPDF_Dictionary* pList = pResources->GetDictBy("ColorSpace"); + CPDF_Dictionary* pList = pResources->GetDictFor("ColorSpace"); if (pList) { pdfium::ScopedSetInsertion insertion(pVisited, pCSObj); - return GetColorSpaceImpl(pList->GetDirectObjectBy(name), nullptr, + return GetColorSpaceImpl(pList->GetDirectObjectFor(name), nullptr, pVisited); } } if (!pCS || !pResources) return pCS; - CPDF_Dictionary* pColorSpaces = pResources->GetDictBy("ColorSpace"); + CPDF_Dictionary* pColorSpaces = pResources->GetDictFor("ColorSpace"); if (!pColorSpaces) return pCS; CPDF_Object* pDefaultCS = nullptr; switch (pCS->GetFamily()) { case PDFCS_DEVICERGB: - pDefaultCS = pColorSpaces->GetDirectObjectBy("DefaultRGB"); + pDefaultCS = pColorSpaces->GetDirectObjectFor("DefaultRGB"); break; case PDFCS_DEVICEGRAY: - pDefaultCS = pColorSpaces->GetDirectObjectBy("DefaultGray"); + pDefaultCS = pColorSpaces->GetDirectObjectFor("DefaultGray"); break; case PDFCS_DEVICECMYK: - pDefaultCS = pColorSpaces->GetDirectObjectBy("DefaultCMYK"); + pDefaultCS = pColorSpaces->GetDirectObjectFor("DefaultCMYK"); break; } if (!pDefaultCS) @@ -357,7 +357,7 @@ CPDF_Pattern* CPDF_DocPageData::GetPattern(CPDF_Object* pPatternObj, } else { CPDF_Dictionary* pDict = pPatternObj ? pPatternObj->GetDict() : nullptr; if (pDict) { - int type = pDict->GetIntegerBy("PatternType"); + int type = pDict->GetIntegerFor("PatternType"); if (type == CPDF_Pattern::TILING) { pPattern = new CPDF_TilingPattern(m_pPDFDoc, pPatternObj, matrix); } else if (type == CPDF_Pattern::SHADING) { @@ -491,9 +491,9 @@ CPDF_StreamAcc* CPDF_DocPageData::GetFontFileStreamAcc( return it->second->AddRef(); CPDF_Dictionary* pFontDict = pFontStream->GetDict(); - int32_t org_size = pFontDict->GetIntegerBy("Length1") + - pFontDict->GetIntegerBy("Length2") + - pFontDict->GetIntegerBy("Length3"); + int32_t org_size = pFontDict->GetIntegerFor("Length1") + + pFontDict->GetIntegerFor("Length2") + + pFontDict->GetIntegerFor("Length3"); org_size = std::max(org_size, 0); CPDF_StreamAcc* pFontFile = new CPDF_StreamAcc; -- cgit v1.2.3