Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(230)

Side by Side Diff: core/src/fpdfdoc/doc_form.cpp

Issue 1701883004: Banish CFX_ByteStringArray and CFX_WideStringArray to the XFA side. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Nits Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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) {
667 allFieldNames.RemoveAll();
668 int nCount = m_pFieldTree->m_Root.CountFields();
669 for (int i = 0; i < nCount; i++) {
670 CPDF_FormField* pField = m_pFieldTree->m_Root.GetField(i);
671 if (pField) {
672 CFX_WideString full_name = GetFullName(pField->GetFieldDict());
673 allFieldNames.Add(full_name);
674 }
675 }
676 }
677 666
678 CPDF_FormField* CPDF_InterForm::GetFieldByDict( 667 CPDF_FormField* CPDF_InterForm::GetFieldByDict(
679 CPDF_Dictionary* pFieldDict) const { 668 CPDF_Dictionary* pFieldDict) const {
680 if (!pFieldDict) { 669 if (!pFieldDict) {
681 return NULL; 670 return NULL;
682 } 671 }
683 CFX_WideString csWName = GetFullName(pFieldDict); 672 CFX_WideString csWName = GetFullName(pFieldDict);
684 return m_pFieldTree->GetField(csWName); 673 return m_pFieldTree->GetField(csWName);
685 } 674 }
686 675
(...skipping 536 matching lines...) Expand 10 before | Expand all | Expand 10 after
1223 FDF_ImportField(pField, L"", bNotify); 1212 FDF_ImportField(pField, L"", bNotify);
1224 } 1213 }
1225 if (bNotify && m_pFormNotify) { 1214 if (bNotify && m_pFormNotify) {
1226 m_pFormNotify->AfterFormImportData(this); 1215 m_pFormNotify->AfterFormImportData(this);
1227 } 1216 }
1228 return TRUE; 1217 return TRUE;
1229 } 1218 }
1230 void CPDF_InterForm::SetFormNotify(const CPDF_FormNotify* pNotify) { 1219 void CPDF_InterForm::SetFormNotify(const CPDF_FormNotify* pNotify) {
1231 m_pFormNotify = (CPDF_FormNotify*)pNotify; 1220 m_pFormNotify = (CPDF_FormNotify*)pNotify;
1232 } 1221 }
OLDNEW
« no previous file with comments | « core/src/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp ('k') | core/src/fpdftext/fpdf_text_int.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698