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

Side by Side Diff: fpdfsdk/cfx_systemhandler.cpp

Issue 2395883002: Use another vector for installed fonts in CFX_FontMapper (Closed)
Patch Set: Created 4 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
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 "fpdfsdk/cfx_systemhandler.h" 7 #include "fpdfsdk/cfx_systemhandler.h"
8 8
9 #include <memory> 9 #include <memory>
10 10
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 if (!pFontMgr) 95 if (!pFontMgr)
96 return false; 96 return false;
97 97
98 CFX_FontMapper* pFontMapper = pFontMgr->GetBuiltinMapper(); 98 CFX_FontMapper* pFontMapper = pFontMgr->GetBuiltinMapper();
99 if (!pFontMapper) 99 if (!pFontMapper)
100 return false; 100 return false;
101 101
102 if (pFontMapper->m_InstalledTTFonts.empty()) 102 if (pFontMapper->m_InstalledTTFonts.empty())
103 pFontMapper->LoadInstalledFonts(); 103 pFontMapper->LoadInstalledFonts();
104 104
105 for (const auto& font : pFontMapper->m_InstalledTTFonts) { 105 for (const auto& it : pFontMapper->m_InstalledTTFonts) {
106 if (font.Compare(sFontFaceName.AsStringC())) 106 if (it.second.Compare(sFontFaceName.AsStringC()))
107 return true; 107 return true;
108 } 108 }
109 return false; 109 return false;
110 } 110 }
111 111
112 CPDF_Font* CFX_SystemHandler::AddNativeTrueTypeFontToPDF( 112 CPDF_Font* CFX_SystemHandler::AddNativeTrueTypeFontToPDF(
113 CPDF_Document* pDoc, 113 CPDF_Document* pDoc,
114 CFX_ByteString sFontFaceName, 114 CFX_ByteString sFontFaceName,
115 uint8_t nCharset) { 115 uint8_t nCharset) {
116 if (!pDoc) 116 if (!pDoc)
(...skipping 17 matching lines...) Expand all
134 return !!m_pEnv->IsSHIFTKeyDown(nFlag); 134 return !!m_pEnv->IsSHIFTKeyDown(nFlag);
135 } 135 }
136 136
137 bool CFX_SystemHandler::IsCTRLKeyDown(uint32_t nFlag) const { 137 bool CFX_SystemHandler::IsCTRLKeyDown(uint32_t nFlag) const {
138 return !!m_pEnv->IsCTRLKeyDown(nFlag); 138 return !!m_pEnv->IsCTRLKeyDown(nFlag);
139 } 139 }
140 140
141 bool CFX_SystemHandler::IsALTKeyDown(uint32_t nFlag) const { 141 bool CFX_SystemHandler::IsALTKeyDown(uint32_t nFlag) const {
142 return !!m_pEnv->IsALTKeyDown(nFlag); 142 return !!m_pEnv->IsALTKeyDown(nFlag);
143 } 143 }
OLDNEW
« core/fxge/ge/cfx_fontmapper.cpp ('K') | « core/fxge/ge/cfx_fontmapper.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698