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 "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 645 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 656 return pNode ? pNode->CountFields() : 0; | 656 return pNode ? pNode->CountFields() : 0; |
| 657 } | 657 } |
| 658 CPDF_FormField* CPDF_InterForm::GetField(FX_DWORD index, | 658 CPDF_FormField* CPDF_InterForm::GetField(FX_DWORD index, |
| 659 const CFX_WideString& csFieldName) { | 659 const CFX_WideString& csFieldName) { |
| 660 if (csFieldName == L"") { | 660 if (csFieldName == L"") { |
| 661 return m_pFieldTree->m_Root.GetField(index); | 661 return m_pFieldTree->m_Root.GetField(index); |
| 662 } | 662 } |
| 663 CFieldTree::_Node* pNode = m_pFieldTree->FindNode(csFieldName); | 663 CFieldTree::_Node* pNode = m_pFieldTree->FindNode(csFieldName); |
| 664 return pNode ? pNode->GetField(index) : nullptr; | 664 return pNode ? pNode->GetField(index) : nullptr; |
| 665 } | 665 } |
| 666 void CPDF_InterForm::GetAllFieldNames(CFX_WideStringArray& allFieldNames) { | 666 |
| 667 allFieldNames.RemoveAll(); | 667 void CPDF_InterForm::GetAllFieldNames( |
|
Lei Zhang
2016/02/17 02:17:21
Dead code, BTW.
Tom Sepez
2016/02/17 18:07:47
And its gone.
| |
| 668 std::vector<CFX_WideString>& allFieldNames) { | |
| 669 allFieldNames.clear(); | |
| 668 int nCount = m_pFieldTree->m_Root.CountFields(); | 670 int nCount = m_pFieldTree->m_Root.CountFields(); |
| 669 for (int i = 0; i < nCount; i++) { | 671 for (int i = 0; i < nCount; i++) { |
| 670 CPDF_FormField* pField = m_pFieldTree->m_Root.GetField(i); | 672 if (CPDF_FormField* pField = m_pFieldTree->m_Root.GetField(i)) |
| 671 if (pField) { | 673 allFieldNames.push_back(GetFullName(pField->GetFieldDict())); |
| 672 CFX_WideString full_name = GetFullName(pField->GetFieldDict()); | |
| 673 allFieldNames.Add(full_name); | |
| 674 } | |
| 675 } | 674 } |
| 676 } | 675 } |
| 677 | 676 |
| 678 CPDF_FormField* CPDF_InterForm::GetFieldByDict( | 677 CPDF_FormField* CPDF_InterForm::GetFieldByDict( |
| 679 CPDF_Dictionary* pFieldDict) const { | 678 CPDF_Dictionary* pFieldDict) const { |
| 680 if (!pFieldDict) { | 679 if (!pFieldDict) { |
| 681 return NULL; | 680 return NULL; |
| 682 } | 681 } |
| 683 CFX_WideString csWName = GetFullName(pFieldDict); | 682 CFX_WideString csWName = GetFullName(pFieldDict); |
| 684 return m_pFieldTree->GetField(csWName); | 683 return m_pFieldTree->GetField(csWName); |
| (...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1223 FDF_ImportField(pField, L"", bNotify); | 1222 FDF_ImportField(pField, L"", bNotify); |
| 1224 } | 1223 } |
| 1225 if (bNotify && m_pFormNotify) { | 1224 if (bNotify && m_pFormNotify) { |
| 1226 m_pFormNotify->AfterFormImportData(this); | 1225 m_pFormNotify->AfterFormImportData(this); |
| 1227 } | 1226 } |
| 1228 return TRUE; | 1227 return TRUE; |
| 1229 } | 1228 } |
| 1230 void CPDF_InterForm::SetFormNotify(const CPDF_FormNotify* pNotify) { | 1229 void CPDF_InterForm::SetFormNotify(const CPDF_FormNotify* pNotify) { |
| 1231 m_pFormNotify = (CPDF_FormNotify*)pNotify; | 1230 m_pFormNotify = (CPDF_FormNotify*)pNotify; |
| 1232 } | 1231 } |
| OLD | NEW |