| 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 "../../include/formfiller/FormFiller.h" | 7 #include "../../include/formfiller/FormFiller.h" |
| 8 #include "../../include/formfiller/FFL_FormFiller.h" | 8 #include "../../include/formfiller/FFL_FormFiller.h" |
| 9 #include "../../include/formfiller/FFL_ListBox.h" | 9 #include "../../include/formfiller/FFL_ListBox.h" |
| 10 //#include "../../include/formfiller/FFL_Module.h" | 10 //#include "../../include/formfiller/FFL_Module.h" |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 FX_UINT nFlags) { | 94 FX_UINT nFlags) { |
| 95 return CFFL_FormFiller::OnChar(pAnnot, nChar, nFlags); | 95 return CFFL_FormFiller::OnChar(pAnnot, nChar, nFlags); |
| 96 } | 96 } |
| 97 | 97 |
| 98 FX_BOOL CFFL_ListBox::IsDataChanged(CPDFSDK_PageView* pPageView) { | 98 FX_BOOL CFFL_ListBox::IsDataChanged(CPDFSDK_PageView* pPageView) { |
| 99 CPWL_ListBox* pListBox = (CPWL_ListBox*)GetPDFWindow(pPageView, FALSE); | 99 CPWL_ListBox* pListBox = (CPWL_ListBox*)GetPDFWindow(pPageView, FALSE); |
| 100 if (!pListBox) | 100 if (!pListBox) |
| 101 return FALSE; | 101 return FALSE; |
| 102 | 102 |
| 103 if (m_pWidget->GetFieldFlags() & FIELDFLAG_MULTISELECT) { | 103 if (m_pWidget->GetFieldFlags() & FIELDFLAG_MULTISELECT) { |
| 104 int nSelCount = 0; | 104 size_t nSelCount = 0; |
| 105 for (int32_t i = 0, sz = pListBox->GetCount(); i < sz; ++i) { | 105 for (int32_t i = 0, sz = pListBox->GetCount(); i < sz; ++i) { |
| 106 if (pListBox->IsItemSelected(i)) { | 106 if (pListBox->IsItemSelected(i)) { |
| 107 if (m_OriginSelections.count(i) == 0) | 107 if (m_OriginSelections.count(i) == 0) |
| 108 return TRUE; | 108 return TRUE; |
| 109 | 109 |
| 110 nSelCount++; | 110 ++nSelCount; |
| 111 } | 111 } |
| 112 } | 112 } |
| 113 | 113 |
| 114 return nSelCount != m_OriginSelections.size(); | 114 return nSelCount != m_OriginSelections.size(); |
| 115 } | 115 } |
| 116 return pListBox->GetCurSel() != m_pWidget->GetSelectedIndex(0); | 116 return pListBox->GetCurSel() != m_pWidget->GetSelectedIndex(0); |
| 117 } | 117 } |
| 118 | 118 |
| 119 void CFFL_ListBox::SaveData(CPDFSDK_PageView* pPageView) { | 119 void CFFL_ListBox::SaveData(CPDFSDK_PageView* pPageView) { |
| 120 ASSERT(m_pWidget != NULL); | 120 ASSERT(m_pWidget != NULL); |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 CPDFSDK_PageView* pPageView = GetCurPageView(); | 239 CPDFSDK_PageView* pPageView = GetCurPageView(); |
| 240 ASSERT(pPageView != NULL); | 240 ASSERT(pPageView != NULL); |
| 241 | 241 |
| 242 if (CommitData(pPageView, nFlag)) { | 242 if (CommitData(pPageView, nFlag)) { |
| 243 DestroyPDFWindow(pPageView); | 243 DestroyPDFWindow(pPageView); |
| 244 m_bValid = FALSE; | 244 m_bValid = FALSE; |
| 245 } | 245 } |
| 246 } | 246 } |
| 247 } | 247 } |
| 248 } | 248 } |
| OLD | NEW |