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

Side by Side Diff: fpdfsdk/fpdf_flatten.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/fpdf_ext.cpp ('k') | fpdfsdk/fpdf_transformpage.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 "public/fpdf_flatten.h" 7 #include "public/fpdf_flatten.h"
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 if (!pSourceDoc || !pPageDic) 89 if (!pSourceDoc || !pPageDic)
90 return FLATTEN_FAIL; 90 return FLATTEN_FAIL;
91 91
92 GetContentsRect(pSourceDoc, pPageDic, pRectArray); 92 GetContentsRect(pSourceDoc, pPageDic, pRectArray);
93 CPDF_Array* pAnnots = pPageDic->GetArrayBy("Annots"); 93 CPDF_Array* pAnnots = pPageDic->GetArrayBy("Annots");
94 if (!pAnnots) 94 if (!pAnnots)
95 return FLATTEN_NOTHINGTODO; 95 return FLATTEN_NOTHINGTODO;
96 96
97 uint32_t dwSize = pAnnots->GetCount(); 97 uint32_t dwSize = pAnnots->GetCount();
98 for (int i = 0; i < (int)dwSize; i++) { 98 for (int i = 0; i < (int)dwSize; i++) {
99 CPDF_Dictionary* pAnnotDic = ToDictionary(pAnnots->GetElementValue(i)); 99 CPDF_Dictionary* pAnnotDic = ToDictionary(pAnnots->GetDirectObjectAt(i));
100 if (!pAnnotDic) 100 if (!pAnnotDic)
101 continue; 101 continue;
102 102
103 CFX_ByteString sSubtype = pAnnotDic->GetStringBy("Subtype"); 103 CFX_ByteString sSubtype = pAnnotDic->GetStringBy("Subtype");
104 if (sSubtype == "Popup") 104 if (sSubtype == "Popup")
105 continue; 105 continue;
106 106
107 int nAnnotFlag = pAnnotDic->GetIntegerBy("F"); 107 int nAnnotFlag = pAnnotDic->GetIntegerBy("F");
108 if (nAnnotFlag & ANNOTFLAG_HIDDEN) 108 if (nAnnotFlag & ANNOTFLAG_HIDDEN)
109 continue; 109 continue;
(...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after
513 pNewXObject->SetData((const uint8_t*)sStream, sStream.GetLength(), FALSE, 513 pNewXObject->SetData((const uint8_t*)sStream, sStream.GetLength(), FALSE,
514 FALSE); 514 FALSE);
515 } 515 }
516 pPageDict->RemoveAt("Annots"); 516 pPageDict->RemoveAt("Annots");
517 517
518 ObjectArray.RemoveAll(); 518 ObjectArray.RemoveAll();
519 RectArray.RemoveAll(); 519 RectArray.RemoveAll();
520 520
521 return FLATTEN_SUCCESS; 521 return FLATTEN_SUCCESS;
522 } 522 }
OLDNEW
« no previous file with comments | « fpdfsdk/fpdf_ext.cpp ('k') | fpdfsdk/fpdf_transformpage.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698