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

Side by Side Diff: fpdfsdk/cfx_systemhandler.cpp

Issue 2395883002: Use another vector for installed fonts in CFX_FontMapper (Closed)
Patch Set: Nits 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
« no previous file with comments | « core/fxge/win32/fx_win32_device.cpp ('k') | no next file » | 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 "fpdfsdk/cfx_systemhandler.h" 7 #include "fpdfsdk/cfx_systemhandler.h"
8 8
9 #include <memory> 9 #include <memory>
10 10
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
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& font : pFontMapper->m_InstalledTTFonts) {
106 if (font.Compare(sFontFaceName.AsStringC())) 106 if (font.Compare(sFontFaceName.AsStringC()))
107 return true; 107 return true;
108 } 108 }
109 for (const auto& fontPair : pFontMapper->m_LocalizedTTFonts) {
110 if (fontPair.first.Compare(sFontFaceName.AsStringC()))
111 return true;
112 }
109 return false; 113 return false;
110 } 114 }
111 115
112 CPDF_Font* CFX_SystemHandler::AddNativeTrueTypeFontToPDF( 116 CPDF_Font* CFX_SystemHandler::AddNativeTrueTypeFontToPDF(
113 CPDF_Document* pDoc, 117 CPDF_Document* pDoc,
114 CFX_ByteString sFontFaceName, 118 CFX_ByteString sFontFaceName,
115 uint8_t nCharset) { 119 uint8_t nCharset) {
116 if (!pDoc) 120 if (!pDoc)
117 return nullptr; 121 return nullptr;
118 122
(...skipping 15 matching lines...) Expand all
134 return !!m_pEnv->IsSHIFTKeyDown(nFlag); 138 return !!m_pEnv->IsSHIFTKeyDown(nFlag);
135 } 139 }
136 140
137 bool CFX_SystemHandler::IsCTRLKeyDown(uint32_t nFlag) const { 141 bool CFX_SystemHandler::IsCTRLKeyDown(uint32_t nFlag) const {
138 return !!m_pEnv->IsCTRLKeyDown(nFlag); 142 return !!m_pEnv->IsCTRLKeyDown(nFlag);
139 } 143 }
140 144
141 bool CFX_SystemHandler::IsALTKeyDown(uint32_t nFlag) const { 145 bool CFX_SystemHandler::IsALTKeyDown(uint32_t nFlag) const {
142 return !!m_pEnv->IsALTKeyDown(nFlag); 146 return !!m_pEnv->IsALTKeyDown(nFlag);
143 } 147 }
OLDNEW
« no previous file with comments | « core/fxge/win32/fx_win32_device.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698