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

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

Issue 1701883004: Banish CFX_ByteStringArray and CFX_WideStringArray to the XFA side. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Nits Created 4 years, 10 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 | « fpdfsdk/src/fpdfformfill.cpp ('k') | fpdfsdk/src/javascript/PublicMethods.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 <algorithm> 7 #include <algorithm>
8 #include <memory> 8 #include <memory>
9 9
10 #include "fpdfsdk/include/fsdk_mgr.h" 10 #include "fpdfsdk/include/fsdk_mgr.h"
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 int32_t nCharset, 169 int32_t nCharset,
170 CFX_ByteString sFontFaceName) { 170 CFX_ByteString sFontFaceName) {
171 CFX_FontMgr* pFontMgr = CFX_GEModule::Get()->GetFontMgr(); 171 CFX_FontMgr* pFontMgr = CFX_GEModule::Get()->GetFontMgr();
172 if (!pFontMgr) 172 if (!pFontMgr)
173 return FALSE; 173 return FALSE;
174 174
175 CFX_FontMapper* pFontMapper = pFontMgr->GetBuiltinMapper(); 175 CFX_FontMapper* pFontMapper = pFontMgr->GetBuiltinMapper();
176 if (!pFontMapper) 176 if (!pFontMapper)
177 return FALSE; 177 return FALSE;
178 178
179 int nSize = pFontMapper->m_InstalledTTFonts.GetSize(); 179 if (pFontMapper->m_InstalledTTFonts.empty())
180 if (nSize == 0) {
181 pFontMapper->LoadInstalledFonts(); 180 pFontMapper->LoadInstalledFonts();
182 nSize = pFontMapper->m_InstalledTTFonts.GetSize();
183 }
184 181
185 for (int i = 0; i < nSize; ++i) { 182 for (const auto& font : pFontMapper->m_InstalledTTFonts) {
186 if (pFontMapper->m_InstalledTTFonts[i].Compare(sFontFaceName)) 183 if (font.Compare(sFontFaceName))
187 return TRUE; 184 return TRUE;
188 } 185 }
189 186
190 return FALSE; 187 return FALSE;
191 } 188 }
192 189
193 CPDF_Font* CFX_SystemHandler::AddNativeTrueTypeFontToPDF( 190 CPDF_Font* CFX_SystemHandler::AddNativeTrueTypeFontToPDF(
194 CPDF_Document* pDoc, 191 CPDF_Document* pDoc,
195 CFX_ByteString sFontFaceName, 192 CFX_ByteString sFontFaceName,
196 uint8_t nCharset) { 193 uint8_t nCharset) {
(...skipping 995 matching lines...) Expand 10 before | Expand all | Expand 10 after
1192 CPDFSDK_Annot* pFocusAnnot = m_pSDKDoc->GetFocusAnnot(); 1189 CPDFSDK_Annot* pFocusAnnot = m_pSDKDoc->GetFocusAnnot();
1193 if (!pFocusAnnot) 1190 if (!pFocusAnnot)
1194 return nullptr; 1191 return nullptr;
1195 1192
1196 for (CPDFSDK_Annot* pAnnot : m_fxAnnotArray) { 1193 for (CPDFSDK_Annot* pAnnot : m_fxAnnotArray) {
1197 if (pAnnot == pFocusAnnot) 1194 if (pAnnot == pFocusAnnot)
1198 return pAnnot; 1195 return pAnnot;
1199 } 1196 }
1200 return nullptr; 1197 return nullptr;
1201 } 1198 }
OLDNEW
« no previous file with comments | « fpdfsdk/src/fpdfformfill.cpp ('k') | fpdfsdk/src/javascript/PublicMethods.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698