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

Side by Side Diff: core/fpdfdoc/cpvt_fontmap.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 unified diff | Download patch
« no previous file with comments | « core/fpdfdoc/cpdf_viewerpreferences.cpp ('k') | core/fpdfdoc/cpvt_generateap.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 PDFium Authors. All rights reserved. 1 // Copyright 2016 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #include "core/fpdfdoc/cpvt_fontmap.h" 7 #include "core/fpdfdoc/cpvt_fontmap.h"
8 8
9 #include "core/fpdfapi/fpdf_font/include/cpdf_font.h" 9 #include "core/fpdfapi/fpdf_font/include/cpdf_font.h"
10 #include "core/fpdfapi/fpdf_parser/include/cpdf_dictionary.h" 10 #include "core/fpdfapi/fpdf_parser/include/cpdf_dictionary.h"
(...skipping 14 matching lines...) Expand all
25 CPVT_FontMap::~CPVT_FontMap() {} 25 CPVT_FontMap::~CPVT_FontMap() {}
26 26
27 void CPVT_FontMap::GetAnnotSysPDFFont(CPDF_Document* pDoc, 27 void CPVT_FontMap::GetAnnotSysPDFFont(CPDF_Document* pDoc,
28 const CPDF_Dictionary* pResDict, 28 const CPDF_Dictionary* pResDict,
29 CPDF_Font*& pSysFont, 29 CPDF_Font*& pSysFont,
30 CFX_ByteString& sSysFontAlias) { 30 CFX_ByteString& sSysFontAlias) {
31 if (!pDoc || !pResDict) 31 if (!pDoc || !pResDict)
32 return; 32 return;
33 33
34 CFX_ByteString sFontAlias; 34 CFX_ByteString sFontAlias;
35 CPDF_Dictionary* pFormDict = pDoc->GetRoot()->GetDictBy("AcroForm"); 35 CPDF_Dictionary* pFormDict = pDoc->GetRoot()->GetDictFor("AcroForm");
36 CPDF_Font* pPDFFont = AddNativeInterFormFont(pFormDict, pDoc, sSysFontAlias); 36 CPDF_Font* pPDFFont = AddNativeInterFormFont(pFormDict, pDoc, sSysFontAlias);
37 if (!pPDFFont) 37 if (!pPDFFont)
38 return; 38 return;
39 39
40 if (CPDF_Dictionary* pFontList = pResDict->GetDictBy("Font")) { 40 if (CPDF_Dictionary* pFontList = pResDict->GetDictFor("Font")) {
41 if (!pFontList->KeyExist(sSysFontAlias)) 41 if (!pFontList->KeyExist(sSysFontAlias))
42 pFontList->SetAtReference(sSysFontAlias, pDoc, pPDFFont->GetFontDict()); 42 pFontList->SetReferenceFor(sSysFontAlias, pDoc, pPDFFont->GetFontDict());
43 } 43 }
44 pSysFont = pPDFFont; 44 pSysFont = pPDFFont;
45 } 45 }
46 46
47 CPDF_Font* CPVT_FontMap::GetPDFFont(int32_t nFontIndex) { 47 CPDF_Font* CPVT_FontMap::GetPDFFont(int32_t nFontIndex) {
48 switch (nFontIndex) { 48 switch (nFontIndex) {
49 case 0: 49 case 0:
50 return m_pDefFont; 50 return m_pDefFont;
51 case 1: 51 case 1:
52 if (!m_pSysFont) { 52 if (!m_pSysFont) {
(...skipping 30 matching lines...) Expand all
83 83
84 int32_t CPVT_FontMap::CharCodeFromUnicode(int32_t nFontIndex, uint16_t word) { 84 int32_t CPVT_FontMap::CharCodeFromUnicode(int32_t nFontIndex, uint16_t word) {
85 ASSERT(false); 85 ASSERT(false);
86 return 0; 86 return 0;
87 } 87 }
88 88
89 int32_t CPVT_FontMap::CharSetFromUnicode(uint16_t word, int32_t nOldCharset) { 89 int32_t CPVT_FontMap::CharSetFromUnicode(uint16_t word, int32_t nOldCharset) {
90 ASSERT(false); 90 ASSERT(false);
91 return FXFONT_ANSI_CHARSET; 91 return FXFONT_ANSI_CHARSET;
92 } 92 }
OLDNEW
« no previous file with comments | « core/fpdfdoc/cpdf_viewerpreferences.cpp ('k') | core/fpdfdoc/cpvt_generateap.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698