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

Side by Side Diff: fpdfsdk/fsdk_baseform.cpp

Issue 1841173002: Rename GetElementValue() to GetDirectObject{By,At}(). (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Fix test name Created 4 years, 8 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
« no previous file with comments | « fpdfsdk/fsdk_baseannot.cpp ('k') | xfa/fxfa/app/xfa_ffdoc.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "fpdfsdk/include/fsdk_baseform.h" 7 #include "fpdfsdk/include/fsdk_baseform.h"
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <memory> 10 #include <memory>
(...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after
460 // Choose the right sub-ap 460 // Choose the right sub-ap
461 const FX_CHAR* ap_entry = "N"; 461 const FX_CHAR* ap_entry = "N";
462 if (mode == CPDF_Annot::Down) 462 if (mode == CPDF_Annot::Down)
463 ap_entry = "D"; 463 ap_entry = "D";
464 else if (mode == CPDF_Annot::Rollover) 464 else if (mode == CPDF_Annot::Rollover)
465 ap_entry = "R"; 465 ap_entry = "R";
466 if (!pAP->KeyExist(ap_entry)) 466 if (!pAP->KeyExist(ap_entry))
467 ap_entry = "N"; 467 ap_entry = "N";
468 468
469 // Get the AP stream or subdirectory 469 // Get the AP stream or subdirectory
470 CPDF_Object* psub = pAP->GetElementValue(ap_entry); 470 CPDF_Object* psub = pAP->GetDirectObjectBy(ap_entry);
471 if (!psub) 471 if (!psub)
472 return FALSE; 472 return FALSE;
473 473
474 int nFieldType = GetFieldType(); 474 int nFieldType = GetFieldType();
475 switch (nFieldType) { 475 switch (nFieldType) {
476 case FIELDTYPE_PUSHBUTTON: 476 case FIELDTYPE_PUSHBUTTON:
477 case FIELDTYPE_COMBOBOX: 477 case FIELDTYPE_COMBOBOX:
478 case FIELDTYPE_LISTBOX: 478 case FIELDTYPE_LISTBOX:
479 case FIELDTYPE_TEXTFIELD: 479 case FIELDTYPE_TEXTFIELD:
480 case FIELDTYPE_SIGNATURE: 480 case FIELDTYPE_SIGNATURE:
(...skipping 1631 matching lines...) Expand 10 before | Expand all | Expand 10 after
2112 2112
2113 int CPDFSDK_InterForm::GetPageIndexByAnnotDict( 2113 int CPDFSDK_InterForm::GetPageIndexByAnnotDict(
2114 CPDF_Document* pDocument, 2114 CPDF_Document* pDocument,
2115 CPDF_Dictionary* pAnnotDict) const { 2115 CPDF_Dictionary* pAnnotDict) const {
2116 ASSERT(pAnnotDict); 2116 ASSERT(pAnnotDict);
2117 2117
2118 for (int i = 0, sz = pDocument->GetPageCount(); i < sz; i++) { 2118 for (int i = 0, sz = pDocument->GetPageCount(); i < sz; i++) {
2119 if (CPDF_Dictionary* pPageDict = pDocument->GetPage(i)) { 2119 if (CPDF_Dictionary* pPageDict = pDocument->GetPage(i)) {
2120 if (CPDF_Array* pAnnots = pPageDict->GetArrayBy("Annots")) { 2120 if (CPDF_Array* pAnnots = pPageDict->GetArrayBy("Annots")) {
2121 for (int j = 0, jsz = pAnnots->GetCount(); j < jsz; j++) { 2121 for (int j = 0, jsz = pAnnots->GetCount(); j < jsz; j++) {
2122 CPDF_Object* pDict = pAnnots->GetElementValue(j); 2122 CPDF_Object* pDict = pAnnots->GetDirectObjectAt(j);
2123 if (pAnnotDict == pDict) { 2123 if (pAnnotDict == pDict) {
2124 return i; 2124 return i;
2125 } 2125 }
2126 } 2126 }
2127 } 2127 }
2128 } 2128 }
2129 } 2129 }
2130 2130
2131 return -1; 2131 return -1;
2132 } 2132 }
(...skipping 727 matching lines...) Expand 10 before | Expand all | Expand 10 after
2860 break; 2860 break;
2861 } 2861 }
2862 } 2862 }
2863 } 2863 }
2864 2864
2865 CFX_FloatRect CBA_AnnotIterator::GetAnnotRect(const CPDFSDK_Annot* pAnnot) { 2865 CFX_FloatRect CBA_AnnotIterator::GetAnnotRect(const CPDFSDK_Annot* pAnnot) {
2866 CFX_FloatRect rcAnnot; 2866 CFX_FloatRect rcAnnot;
2867 pAnnot->GetPDFAnnot()->GetRect(rcAnnot); 2867 pAnnot->GetPDFAnnot()->GetRect(rcAnnot);
2868 return rcAnnot; 2868 return rcAnnot;
2869 } 2869 }
OLDNEW
« no previous file with comments | « fpdfsdk/fsdk_baseannot.cpp ('k') | xfa/fxfa/app/xfa_ffdoc.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698