OLD | NEW |
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 "fpdfsdk/include/fsdk_mgr.h" | 7 #include "fpdfsdk/include/fsdk_mgr.h" |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <memory> | 10 #include <memory> |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 return FALSE; | 179 return FALSE; |
180 | 180 |
181 CFX_FontMapper* pFontMapper = pFontMgr->GetBuiltinMapper(); | 181 CFX_FontMapper* pFontMapper = pFontMgr->GetBuiltinMapper(); |
182 if (!pFontMapper) | 182 if (!pFontMapper) |
183 return FALSE; | 183 return FALSE; |
184 | 184 |
185 if (pFontMapper->m_InstalledTTFonts.empty()) | 185 if (pFontMapper->m_InstalledTTFonts.empty()) |
186 pFontMapper->LoadInstalledFonts(); | 186 pFontMapper->LoadInstalledFonts(); |
187 | 187 |
188 for (const auto& font : pFontMapper->m_InstalledTTFonts) { | 188 for (const auto& font : pFontMapper->m_InstalledTTFonts) { |
189 if (font.Compare(sFontFaceName.AsByteStringC())) | 189 if (font.Compare(sFontFaceName.AsStringC())) |
190 return TRUE; | 190 return TRUE; |
191 } | 191 } |
192 | 192 |
193 return FALSE; | 193 return FALSE; |
194 } | 194 } |
195 | 195 |
196 CPDF_Font* CFX_SystemHandler::AddNativeTrueTypeFontToPDF( | 196 CPDF_Font* CFX_SystemHandler::AddNativeTrueTypeFontToPDF( |
197 CPDF_Document* pDoc, | 197 CPDF_Document* pDoc, |
198 CFX_ByteString sFontFaceName, | 198 CFX_ByteString sFontFaceName, |
199 uint8_t nCharset) { | 199 uint8_t nCharset) { |
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
469 CPDF_Document* pPDFDoc = GetPDFDocument(); | 469 CPDF_Document* pPDFDoc = GetPDFDocument(); |
470 CPDF_DocJSActions docJS(pPDFDoc); | 470 CPDF_DocJSActions docJS(pPDFDoc); |
471 int iCount = docJS.CountJSActions(); | 471 int iCount = docJS.CountJSActions(); |
472 if (iCount < 1) | 472 if (iCount < 1) |
473 return; | 473 return; |
474 for (int i = 0; i < iCount; i++) { | 474 for (int i = 0; i < iCount; i++) { |
475 CFX_ByteString csJSName; | 475 CFX_ByteString csJSName; |
476 CPDF_Action jsAction = docJS.GetJSAction(i, csJSName); | 476 CPDF_Action jsAction = docJS.GetJSAction(i, csJSName); |
477 if (m_pEnv->GetActionHander()) | 477 if (m_pEnv->GetActionHander()) |
478 m_pEnv->GetActionHander()->DoAction_JavaScript( | 478 m_pEnv->GetActionHander()->DoAction_JavaScript( |
479 jsAction, CFX_WideString::FromLocal(csJSName.AsByteStringC()), this); | 479 jsAction, CFX_WideString::FromLocal(csJSName.AsStringC()), this); |
480 } | 480 } |
481 } | 481 } |
482 | 482 |
483 FX_BOOL CPDFSDK_Document::ProcOpenAction() { | 483 FX_BOOL CPDFSDK_Document::ProcOpenAction() { |
484 if (!m_pDoc) | 484 if (!m_pDoc) |
485 return FALSE; | 485 return FALSE; |
486 | 486 |
487 CPDF_Dictionary* pRoot = GetPDFDocument()->GetRoot(); | 487 CPDF_Dictionary* pRoot = GetPDFDocument()->GetRoot(); |
488 if (!pRoot) | 488 if (!pRoot) |
489 return FALSE; | 489 return FALSE; |
(...skipping 709 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1199 CPDFSDK_Annot* pFocusAnnot = m_pSDKDoc->GetFocusAnnot(); | 1199 CPDFSDK_Annot* pFocusAnnot = m_pSDKDoc->GetFocusAnnot(); |
1200 if (!pFocusAnnot) | 1200 if (!pFocusAnnot) |
1201 return nullptr; | 1201 return nullptr; |
1202 | 1202 |
1203 for (CPDFSDK_Annot* pAnnot : m_fxAnnotArray) { | 1203 for (CPDFSDK_Annot* pAnnot : m_fxAnnotArray) { |
1204 if (pAnnot == pFocusAnnot) | 1204 if (pAnnot == pFocusAnnot) |
1205 return pAnnot; | 1205 return pAnnot; |
1206 } | 1206 } |
1207 return nullptr; | 1207 return nullptr; |
1208 } | 1208 } |
OLD | NEW |