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

Side by Side Diff: fpdfsdk/src/fsdk_mgr.cpp

Issue 1414463006: Merge to XFA: Make CFX_FontMgr member variables private. (try 2) (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: rebase Created 5 years, 2 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/src/fxge/ge/fx_ge_text.cpp ('k') | xfa/src/fgas/src/font/fx_stdfontmgr.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 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 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 "../../public/fpdf_ext.h" 7 #include "../../public/fpdf_ext.h"
8 #include "../../third_party/base/nonstd_unique_ptr.h" 8 #include "../../third_party/base/nonstd_unique_ptr.h"
9 #include "../include/formfiller/FFL_FormFiller.h" 9 #include "../include/formfiller/FFL_FormFiller.h"
10 #include "../include/fsdk_define.h" 10 #include "../include/fsdk_define.h"
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 } 139 }
140 140
141 CFX_ByteString CFX_SystemHandler::GetNativeTrueTypeFont(int32_t nCharset) { 141 CFX_ByteString CFX_SystemHandler::GetNativeTrueTypeFont(int32_t nCharset) {
142 return ""; 142 return "";
143 } 143 }
144 144
145 FX_BOOL CFX_SystemHandler::FindNativeTrueTypeFont( 145 FX_BOOL CFX_SystemHandler::FindNativeTrueTypeFont(
146 int32_t nCharset, 146 int32_t nCharset,
147 CFX_ByteString sFontFaceName) { 147 CFX_ByteString sFontFaceName) {
148 CFX_FontMgr* pFontMgr = CFX_GEModule::Get()->GetFontMgr(); 148 CFX_FontMgr* pFontMgr = CFX_GEModule::Get()->GetFontMgr();
149 if (pFontMgr) { 149 if (!pFontMgr)
150 CFX_FontMapper* pFontMapper = pFontMgr->m_pBuiltinMapper; 150 return FALSE;
151 if (pFontMapper) {
152 int nSize = pFontMapper->m_InstalledTTFonts.GetSize();
153 if (nSize == 0) {
154 pFontMapper->LoadInstalledFonts();
155 nSize = pFontMapper->m_InstalledTTFonts.GetSize();
156 }
157 151
158 for (int i = 0; i < nSize; i++) { 152 CFX_FontMapper* pFontMapper = pFontMgr->GetBuiltinMapper();
159 if (pFontMapper->m_InstalledTTFonts[i].Compare(sFontFaceName)) 153 if (!pFontMapper)
160 return TRUE; 154 return FALSE;
161 } 155
162 } 156 int nSize = pFontMapper->m_InstalledTTFonts.GetSize();
157 if (nSize == 0) {
158 pFontMapper->LoadInstalledFonts();
159 nSize = pFontMapper->m_InstalledTTFonts.GetSize();
160 }
161
162 for (int i = 0; i < nSize; ++i) {
163 if (pFontMapper->m_InstalledTTFonts[i].Compare(sFontFaceName))
164 return TRUE;
163 } 165 }
164 166
165 return FALSE; 167 return FALSE;
166 } 168 }
167 169
168 static int CharSet2CP(int charset) { 170 static int CharSet2CP(int charset) {
169 if (charset == 128) 171 if (charset == 128)
170 return 932; 172 return 932;
171 if (charset == 134) 173 if (charset == 134)
172 return 936; 174 return 936;
(...skipping 1003 matching lines...) Expand 10 before | Expand all | Expand 10 after
1176 if (!pFocusAnnot) 1178 if (!pFocusAnnot)
1177 return NULL; 1179 return NULL;
1178 1180
1179 for (int i = 0; i < m_fxAnnotArray.GetSize(); i++) { 1181 for (int i = 0; i < m_fxAnnotArray.GetSize(); i++) {
1180 CPDFSDK_Annot* pAnnot = (CPDFSDK_Annot*)m_fxAnnotArray.GetAt(i); 1182 CPDFSDK_Annot* pAnnot = (CPDFSDK_Annot*)m_fxAnnotArray.GetAt(i);
1181 if (pAnnot == pFocusAnnot) 1183 if (pAnnot == pFocusAnnot)
1182 return pAnnot; 1184 return pAnnot;
1183 } 1185 }
1184 return NULL; 1186 return NULL;
1185 } 1187 }
OLDNEW
« no previous file with comments | « core/src/fxge/ge/fx_ge_text.cpp ('k') | xfa/src/fgas/src/font/fx_stdfontmgr.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698