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/formfiller/FFL_CBA_Fontmap.h" | 7 #include "fpdfsdk/include/formfiller/FFL_CBA_Fontmap.h" |
8 #include "fpdfsdk/include/formfiller/FFL_ComboBox.h" | 8 #include "fpdfsdk/include/formfiller/FFL_ComboBox.h" |
9 #include "fpdfsdk/include/formfiller/FFL_FormFiller.h" | 9 #include "fpdfsdk/include/formfiller/FFL_FormFiller.h" |
10 #include "fpdfsdk/include/formfiller/FFL_IFormFiller.h" | 10 #include "fpdfsdk/include/formfiller/FFL_IFormFiller.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 } | 25 } |
26 | 26 |
27 PWL_CREATEPARAM CFFL_ComboBox::GetCreateParam() { | 27 PWL_CREATEPARAM CFFL_ComboBox::GetCreateParam() { |
28 PWL_CREATEPARAM cp = CFFL_FormFiller::GetCreateParam(); | 28 PWL_CREATEPARAM cp = CFFL_FormFiller::GetCreateParam(); |
29 | 29 |
30 int nFlags = m_pWidget->GetFieldFlags(); | 30 int nFlags = m_pWidget->GetFieldFlags(); |
31 if (nFlags & FIELDFLAG_EDIT) { | 31 if (nFlags & FIELDFLAG_EDIT) { |
32 cp.dwFlags |= PCBS_ALLOWCUSTOMTEXT; | 32 cp.dwFlags |= PCBS_ALLOWCUSTOMTEXT; |
33 } | 33 } |
34 | 34 |
35 if (!m_pFontMap) { | 35 if (!m_pFontMap) |
36 m_pFontMap = new CBA_FontMap(m_pWidget, GetSystemHandler()); | 36 m_pFontMap = new CBA_FontMap(m_pWidget, GetSystemHandler()); |
37 m_pFontMap->Initial(); | |
38 } | |
39 | |
40 cp.pFontMap = m_pFontMap; | 37 cp.pFontMap = m_pFontMap; |
41 cp.pFocusHandler = this; | 38 cp.pFocusHandler = this; |
42 | 39 |
43 return cp; | 40 return cp; |
44 } | 41 } |
45 | 42 |
46 CPWL_Wnd* CFFL_ComboBox::NewPDFWindow(const PWL_CREATEPARAM& cp, | 43 CPWL_Wnd* CFFL_ComboBox::NewPDFWindow(const PWL_CREATEPARAM& cp, |
47 CPDFSDK_PageView* pPageView) { | 44 CPDFSDK_PageView* pPageView) { |
48 CPWL_ComboBox* pWnd = new CPWL_ComboBox(); | 45 CPWL_ComboBox* pWnd = new CPWL_ComboBox(); |
49 pWnd->AttachFFLData(this); | 46 pWnd->AttachFFLData(this); |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 if (nExport >= 0) { | 288 if (nExport >= 0) { |
292 if (CPDF_FormField* pFormField = m_pWidget->GetFormField()) { | 289 if (CPDF_FormField* pFormField = m_pWidget->GetFormField()) { |
293 swRet = pFormField->GetOptionValue(nExport); | 290 swRet = pFormField->GetOptionValue(nExport); |
294 if (swRet.IsEmpty()) | 291 if (swRet.IsEmpty()) |
295 swRet = pFormField->GetOptionLabel(nExport); | 292 swRet = pFormField->GetOptionLabel(nExport); |
296 } | 293 } |
297 } | 294 } |
298 | 295 |
299 return swRet; | 296 return swRet; |
300 } | 297 } |
OLD | NEW |