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 "core/include/fpdfdoc/fpdf_doc.h" | 7 #include "core/include/fpdfdoc/fpdf_doc.h" |
8 #include "doc_utils.h" | 8 #include "doc_utils.h" |
9 #include "third_party/base/stl_util.h" | 9 #include "third_party/base/stl_util.h" |
10 | 10 |
(...skipping 1142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1153 int iRet = 0; | 1153 int iRet = 0; |
1154 if (iType == FIELDTYPE_LISTBOX) { | 1154 if (iType == FIELDTYPE_LISTBOX) { |
1155 iRet = m_pFormNotify->BeforeSelectionChange(pField, csWValue); | 1155 iRet = m_pFormNotify->BeforeSelectionChange(pField, csWValue); |
1156 } else if (iType == FIELDTYPE_COMBOBOX || iType == FIELDTYPE_TEXTFIELD) { | 1156 } else if (iType == FIELDTYPE_COMBOBOX || iType == FIELDTYPE_TEXTFIELD) { |
1157 iRet = m_pFormNotify->BeforeValueChange(pField, csWValue); | 1157 iRet = m_pFormNotify->BeforeValueChange(pField, csWValue); |
1158 } | 1158 } |
1159 if (iRet < 0) { | 1159 if (iRet < 0) { |
1160 return; | 1160 return; |
1161 } | 1161 } |
1162 } | 1162 } |
1163 CFX_ByteArray statusArray; | 1163 std::vector<bool> statusArray; |
1164 if (iType == FIELDTYPE_CHECKBOX || iType == FIELDTYPE_RADIOBUTTON) { | 1164 if (iType == FIELDTYPE_CHECKBOX || iType == FIELDTYPE_RADIOBUTTON) { |
1165 SaveCheckedFieldStatus(pField, statusArray); | 1165 statusArray = SaveCheckedFieldStatus(pField); |
1166 } | 1166 } |
1167 pField->SetValue(csWValue); | 1167 pField->SetValue(csWValue); |
1168 CPDF_FormField::Type eType = pField->GetType(); | 1168 CPDF_FormField::Type eType = pField->GetType(); |
1169 if ((eType == CPDF_FormField::ListBox || eType == CPDF_FormField::ComboBox) && | 1169 if ((eType == CPDF_FormField::ListBox || eType == CPDF_FormField::ComboBox) && |
1170 pFieldDict->KeyExist("Opt")) { | 1170 pFieldDict->KeyExist("Opt")) { |
1171 pField->m_pDict->SetAt("Opt", | 1171 pField->m_pDict->SetAt("Opt", |
1172 pFieldDict->GetElementValue("Opt")->Clone(TRUE)); | 1172 pFieldDict->GetElementValue("Opt")->Clone(TRUE)); |
1173 } | 1173 } |
1174 if (bNotify && m_pFormNotify) { | 1174 if (bNotify && m_pFormNotify) { |
1175 if (iType == FIELDTYPE_CHECKBOX || iType == FIELDTYPE_RADIOBUTTON) { | 1175 if (iType == FIELDTYPE_CHECKBOX || iType == FIELDTYPE_RADIOBUTTON) { |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1212 FDF_ImportField(pField, L"", bNotify); | 1212 FDF_ImportField(pField, L"", bNotify); |
1213 } | 1213 } |
1214 if (bNotify && m_pFormNotify) { | 1214 if (bNotify && m_pFormNotify) { |
1215 m_pFormNotify->AfterFormImportData(this); | 1215 m_pFormNotify->AfterFormImportData(this); |
1216 } | 1216 } |
1217 return TRUE; | 1217 return TRUE; |
1218 } | 1218 } |
1219 void CPDF_InterForm::SetFormNotify(const CPDF_FormNotify* pNotify) { | 1219 void CPDF_InterForm::SetFormNotify(const CPDF_FormNotify* pNotify) { |
1220 m_pFormNotify = (CPDF_FormNotify*)pNotify; | 1220 m_pFormNotify = (CPDF_FormNotify*)pNotify; |
1221 } | 1221 } |
OLD | NEW |