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

Side by Side Diff: core/fpdfdoc/doc_utils.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 | « core/fpdfdoc/doc_tagged.cpp ('k') | core/fpdftext/fpdf_text_int.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 <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "core/fpdfapi/fpdf_font/include/cpdf_font.h" 10 #include "core/fpdfapi/fpdf_font/include/cpdf_font.h"
(...skipping 13 matching lines...) Expand all
24 if (pLimits && 24 if (pLimits &&
25 (num < pLimits->GetIntegerAt(0) || num > pLimits->GetIntegerAt(1))) { 25 (num < pLimits->GetIntegerAt(0) || num > pLimits->GetIntegerAt(1))) {
26 return NULL; 26 return NULL;
27 } 27 }
28 CPDF_Array* pNumbers = pNode->GetArrayBy("Nums"); 28 CPDF_Array* pNumbers = pNode->GetArrayBy("Nums");
29 if (pNumbers) { 29 if (pNumbers) {
30 uint32_t dwCount = pNumbers->GetCount() / 2; 30 uint32_t dwCount = pNumbers->GetCount() / 2;
31 for (uint32_t i = 0; i < dwCount; i++) { 31 for (uint32_t i = 0; i < dwCount; i++) {
32 int index = pNumbers->GetIntegerAt(i * 2); 32 int index = pNumbers->GetIntegerAt(i * 2);
33 if (num == index) { 33 if (num == index) {
34 return pNumbers->GetElementValue(i * 2 + 1); 34 return pNumbers->GetDirectObjectAt(i * 2 + 1);
35 } 35 }
36 if (index > num) { 36 if (index > num) {
37 break; 37 break;
38 } 38 }
39 } 39 }
40 return NULL; 40 return NULL;
41 } 41 }
42 CPDF_Array* pKids = pNode->GetArrayBy("Kids"); 42 CPDF_Array* pKids = pNode->GetArrayBy("Kids");
43 if (!pKids) { 43 if (!pKids) {
44 return NULL; 44 return NULL;
(...skipping 691 matching lines...) Expand 10 before | Expand all | Expand 10 after
736 736
737 CPDF_Object* FPDF_GetFieldAttr(CPDF_Dictionary* pFieldDict, 737 CPDF_Object* FPDF_GetFieldAttr(CPDF_Dictionary* pFieldDict,
738 const FX_CHAR* name, 738 const FX_CHAR* name,
739 int nLevel) { 739 int nLevel) {
740 if (nLevel > FPDFDOC_UTILS_MAXRECURSION) { 740 if (nLevel > FPDFDOC_UTILS_MAXRECURSION) {
741 return NULL; 741 return NULL;
742 } 742 }
743 if (!pFieldDict) { 743 if (!pFieldDict) {
744 return NULL; 744 return NULL;
745 } 745 }
746 CPDF_Object* pAttr = pFieldDict->GetElementValue(name); 746 CPDF_Object* pAttr = pFieldDict->GetDirectObjectBy(name);
747 if (pAttr) { 747 if (pAttr) {
748 return pAttr; 748 return pAttr;
749 } 749 }
750 CPDF_Dictionary* pParent = pFieldDict->GetDictBy("Parent"); 750 CPDF_Dictionary* pParent = pFieldDict->GetDictBy("Parent");
751 if (!pParent) { 751 if (!pParent) {
752 return NULL; 752 return NULL;
753 } 753 }
754 return FPDF_GetFieldAttr(pParent, name, nLevel + 1); 754 return FPDF_GetFieldAttr(pParent, name, nLevel + 1);
755 } 755 }
OLDNEW
« no previous file with comments | « core/fpdfdoc/doc_tagged.cpp ('k') | core/fpdftext/fpdf_text_int.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698