Chromium Code Reviews| 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> | |
|
Tom Sepez
2016/03/08 19:27:05
Hmm. What does this fix?
dsinclair
2016/03/08 21:08:01
bool CPDF_InterForm::ResetForm(const std::vector<C
Tom Sepez
2016/03/08 21:18:09
Acknowledged.
| |
| 8 | |
| 7 #include "core/include/fpdfdoc/fpdf_doc.h" | 9 #include "core/include/fpdfdoc/fpdf_doc.h" |
| 8 #include "core/src/fpdfdoc/doc_utils.h" | 10 #include "core/src/fpdfdoc/doc_utils.h" |
| 9 #include "third_party/base/stl_util.h" | 11 #include "third_party/base/stl_util.h" |
| 10 | 12 |
| 11 namespace { | 13 namespace { |
| 12 | 14 |
| 13 const int nMaxRecursion = 32; | 15 const int nMaxRecursion = 32; |
| 14 | 16 |
| 15 const struct SupportFieldEncoding { | 17 const struct SupportFieldEncoding { |
| 16 const FX_CHAR* m_name; | 18 const FX_CHAR* m_name; |
| (...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 377 return fd.bFind; | 379 return fd.bFind; |
| 378 } | 380 } |
| 379 static FX_BOOL RetrieveSpecificFont(uint8_t charSet, | 381 static FX_BOOL RetrieveSpecificFont(uint8_t charSet, |
| 380 uint8_t pitchAndFamily, | 382 uint8_t pitchAndFamily, |
| 381 LPCSTR pcsFontName, | 383 LPCSTR pcsFontName, |
| 382 LOGFONTA& lf) { | 384 LOGFONTA& lf) { |
| 383 memset(&lf, 0, sizeof(LOGFONTA)); | 385 memset(&lf, 0, sizeof(LOGFONTA)); |
| 384 lf.lfCharSet = charSet; | 386 lf.lfCharSet = charSet; |
| 385 lf.lfPitchAndFamily = pitchAndFamily; | 387 lf.lfPitchAndFamily = pitchAndFamily; |
| 386 if (pcsFontName) { | 388 if (pcsFontName) { |
| 389 // TODO(dsinclair): Should this be snprintf? | |
|
Tom Sepez
2016/03/08 19:27:04
you mean strncpy?
dsinclair
2016/03/08 21:08:01
Was going by:
core/src/fpdfdoc/doc_form.cpp:390:
| |
| 387 strcpy(lf.lfFaceName, pcsFontName); | 390 strcpy(lf.lfFaceName, pcsFontName); |
| 388 } | 391 } |
| 389 return RetrieveSpecificFont(lf); | 392 return RetrieveSpecificFont(lf); |
| 390 } | 393 } |
| 391 #ifdef PDF_ENABLE_XFA | 394 #ifdef PDF_ENABLE_XFA |
| 392 static FX_BOOL RetrieveStockFont(int iFontObject, | 395 static FX_BOOL RetrieveStockFont(int iFontObject, |
| 393 uint8_t charSet, | 396 uint8_t charSet, |
| 394 LOGFONTA& lf) { | 397 LOGFONTA& lf) { |
| 395 HFONT hFont = (HFONT)::GetStockObject(iFontObject); | 398 HFONT hFont = (HFONT)::GetStockObject(iFontObject); |
| 396 if (hFont) { | 399 if (hFont) { |
| (...skipping 809 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1206 FDF_ImportField(pField, L"", bNotify); | 1209 FDF_ImportField(pField, L"", bNotify); |
| 1207 } | 1210 } |
| 1208 if (bNotify && m_pFormNotify) { | 1211 if (bNotify && m_pFormNotify) { |
| 1209 m_pFormNotify->AfterFormImportData(this); | 1212 m_pFormNotify->AfterFormImportData(this); |
| 1210 } | 1213 } |
| 1211 return TRUE; | 1214 return TRUE; |
| 1212 } | 1215 } |
| 1213 void CPDF_InterForm::SetFormNotify(const CPDF_FormNotify* pNotify) { | 1216 void CPDF_InterForm::SetFormNotify(const CPDF_FormNotify* pNotify) { |
| 1214 m_pFormNotify = (CPDF_FormNotify*)pNotify; | 1217 m_pFormNotify = (CPDF_FormNotify*)pNotify; |
| 1215 } | 1218 } |
| OLD | NEW |