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 <vector> |
| 8 |
7 #include "core/include/fpdfapi/cpdf_document.h" | 9 #include "core/include/fpdfapi/cpdf_document.h" |
8 #include "core/include/fpdfdoc/fpdf_doc.h" | 10 #include "core/include/fpdfdoc/fpdf_doc.h" |
9 #include "core/src/fpdfdoc/doc_utils.h" | 11 #include "core/src/fpdfdoc/doc_utils.h" |
10 #include "third_party/base/stl_util.h" | 12 #include "third_party/base/stl_util.h" |
11 | 13 |
12 namespace { | 14 namespace { |
13 | 15 |
14 const int nMaxRecursion = 32; | 16 const int nMaxRecursion = 32; |
15 | 17 |
16 const struct SupportFieldEncoding { | 18 const struct SupportFieldEncoding { |
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
378 return fd.bFind; | 380 return fd.bFind; |
379 } | 381 } |
380 static FX_BOOL RetrieveSpecificFont(uint8_t charSet, | 382 static FX_BOOL RetrieveSpecificFont(uint8_t charSet, |
381 uint8_t pitchAndFamily, | 383 uint8_t pitchAndFamily, |
382 LPCSTR pcsFontName, | 384 LPCSTR pcsFontName, |
383 LOGFONTA& lf) { | 385 LOGFONTA& lf) { |
384 memset(&lf, 0, sizeof(LOGFONTA)); | 386 memset(&lf, 0, sizeof(LOGFONTA)); |
385 lf.lfCharSet = charSet; | 387 lf.lfCharSet = charSet; |
386 lf.lfPitchAndFamily = pitchAndFamily; | 388 lf.lfPitchAndFamily = pitchAndFamily; |
387 if (pcsFontName) { | 389 if (pcsFontName) { |
| 390 // TODO(dsinclair): Should this be strncpy? |
388 strcpy(lf.lfFaceName, pcsFontName); | 391 strcpy(lf.lfFaceName, pcsFontName); |
389 } | 392 } |
390 return RetrieveSpecificFont(lf); | 393 return RetrieveSpecificFont(lf); |
391 } | 394 } |
392 #endif // _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ | 395 #endif // _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ |
393 | 396 |
394 CPDF_Font* CPDF_InterForm::AddStandardFont(CPDF_Document* pDocument, | 397 CPDF_Font* CPDF_InterForm::AddStandardFont(CPDF_Document* pDocument, |
395 CFX_ByteString csFontName) { | 398 CFX_ByteString csFontName) { |
396 if (!pDocument || csFontName.IsEmpty()) | 399 if (!pDocument || csFontName.IsEmpty()) |
397 return nullptr; | 400 return nullptr; |
(...skipping 794 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1192 FDF_ImportField(pField, L"", bNotify); | 1195 FDF_ImportField(pField, L"", bNotify); |
1193 } | 1196 } |
1194 if (bNotify && m_pFormNotify) { | 1197 if (bNotify && m_pFormNotify) { |
1195 m_pFormNotify->AfterFormImportData(this); | 1198 m_pFormNotify->AfterFormImportData(this); |
1196 } | 1199 } |
1197 return TRUE; | 1200 return TRUE; |
1198 } | 1201 } |
1199 void CPDF_InterForm::SetFormNotify(const CPDF_FormNotify* pNotify) { | 1202 void CPDF_InterForm::SetFormNotify(const CPDF_FormNotify* pNotify) { |
1200 m_pFormNotify = (CPDF_FormNotify*)pNotify; | 1203 m_pFormNotify = (CPDF_FormNotify*)pNotify; |
1201 } | 1204 } |
OLD | NEW |