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

Side by Side Diff: core/fpdfapi/fpdf_parser/include/cpdf_array.h

Issue 2361713002: Remove some objnum locals with AddIndirectObject (Closed)
Patch Set: Same treatment for arrays Created 4 years, 3 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 2016 PDFium Authors. All rights reserved. 1 // Copyright 2016 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 #ifndef CORE_FPDFAPI_FPDF_PARSER_INCLUDE_CPDF_ARRAY_H_ 7 #ifndef CORE_FPDFAPI_FPDF_PARSER_INCLUDE_CPDF_ARRAY_H_
8 #define CORE_FPDFAPI_FPDF_PARSER_INCLUDE_CPDF_ARRAY_H_ 8 #define CORE_FPDFAPI_FPDF_PARSER_INCLUDE_CPDF_ARRAY_H_
9 9
10 #include <set> 10 #include <set>
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 void SetAt(size_t index, CPDF_Object* pObj); 46 void SetAt(size_t index, CPDF_Object* pObj);
47 void InsertAt(size_t index, CPDF_Object* pObj); 47 void InsertAt(size_t index, CPDF_Object* pObj);
48 void RemoveAt(size_t index, size_t nCount = 1); 48 void RemoveAt(size_t index, size_t nCount = 1);
49 49
50 void Add(CPDF_Object* pObj); 50 void Add(CPDF_Object* pObj);
51 void AddNumber(FX_FLOAT f); 51 void AddNumber(FX_FLOAT f);
52 void AddInteger(int i); 52 void AddInteger(int i);
53 void AddString(const CFX_ByteString& str); 53 void AddString(const CFX_ByteString& str);
54 void AddName(const CFX_ByteString& str); 54 void AddName(const CFX_ByteString& str);
55 void AddReference(CPDF_IndirectObjectHolder* pDoc, uint32_t objnum); 55 void AddReference(CPDF_IndirectObjectHolder* pDoc, uint32_t objnum);
56 void AddReference(CPDF_IndirectObjectHolder* pDoc, CPDF_Object* obj) {
57 AddReference(pDoc, obj->GetObjNum());
58 }
59 56
60 iterator begin() { return m_Objects.begin(); } 57 iterator begin() { return m_Objects.begin(); }
61 iterator end() { return m_Objects.end(); } 58 iterator end() { return m_Objects.end(); }
62 const_iterator begin() const { return m_Objects.begin(); } 59 const_iterator begin() const { return m_Objects.begin(); }
63 const_iterator end() const { return m_Objects.end(); } 60 const_iterator end() const { return m_Objects.end(); }
64 61
65 protected: 62 protected:
66 ~CPDF_Array() override; 63 ~CPDF_Array() override;
67 64
68 CPDF_Object* CloneNonCyclic( 65 CPDF_Object* CloneNonCyclic(
69 bool bDirect, 66 bool bDirect,
70 std::set<const CPDF_Object*>* pVisited) const override; 67 std::set<const CPDF_Object*>* pVisited) const override;
71 68
72 std::vector<CPDF_Object*> m_Objects; 69 std::vector<CPDF_Object*> m_Objects;
73 }; 70 };
74 71
75 #endif // CORE_FPDFAPI_FPDF_PARSER_INCLUDE_CPDF_ARRAY_H_ 72 #endif // CORE_FPDFAPI_FPDF_PARSER_INCLUDE_CPDF_ARRAY_H_
OLDNEW
« no previous file with comments | « core/fpdfapi/fpdf_parser/cpdf_object_unittest.cpp ('k') | core/fpdfapi/fpdf_parser/include/cpdf_dictionary.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698