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

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

Issue 2361713002: Remove some objnum locals with AddIndirectObject (Closed)
Patch Set: Same treatment for arrays Created 4 years, 2 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/fpdfapi/fpdf_parser/include/cpdf_array.h ('k') | core/fpdfdoc/cpdf_formfield_unittest.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 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_DICTIONARY_H_ 7 #ifndef CORE_FPDFAPI_FPDF_PARSER_INCLUDE_CPDF_DICTIONARY_H_
8 #define CORE_FPDFAPI_FPDF_PARSER_INCLUDE_CPDF_DICTIONARY_H_ 8 #define CORE_FPDFAPI_FPDF_PARSER_INCLUDE_CPDF_DICTIONARY_H_
9 9
10 #include <map> 10 #include <map>
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 56
57 // Set* functions invalidate iterators for the element with the key |key|. 57 // Set* functions invalidate iterators for the element with the key |key|.
58 void SetFor(const CFX_ByteString& key, CPDF_Object* pObj); 58 void SetFor(const CFX_ByteString& key, CPDF_Object* pObj);
59 void SetNameFor(const CFX_ByteString& key, const CFX_ByteString& name); 59 void SetNameFor(const CFX_ByteString& key, const CFX_ByteString& name);
60 void SetStringFor(const CFX_ByteString& key, const CFX_ByteString& str); 60 void SetStringFor(const CFX_ByteString& key, const CFX_ByteString& str);
61 void SetIntegerFor(const CFX_ByteString& key, int i); 61 void SetIntegerFor(const CFX_ByteString& key, int i);
62 void SetNumberFor(const CFX_ByteString& key, FX_FLOAT f); 62 void SetNumberFor(const CFX_ByteString& key, FX_FLOAT f);
63 void SetReferenceFor(const CFX_ByteString& key, 63 void SetReferenceFor(const CFX_ByteString& key,
64 CPDF_IndirectObjectHolder* pDoc, 64 CPDF_IndirectObjectHolder* pDoc,
65 uint32_t objnum); 65 uint32_t objnum);
66 void SetReferenceFor(const CFX_ByteString& key,
67 CPDF_IndirectObjectHolder* pDoc,
68 CPDF_Object* obj) {
69 SetReferenceFor(key, pDoc, obj->GetObjNum());
70 }
71 void SetRectFor(const CFX_ByteString& key, const CFX_FloatRect& rect); 66 void SetRectFor(const CFX_ByteString& key, const CFX_FloatRect& rect);
72 void SetMatrixFor(const CFX_ByteString& key, const CFX_Matrix& matrix); 67 void SetMatrixFor(const CFX_ByteString& key, const CFX_Matrix& matrix);
73 void SetBooleanFor(const CFX_ByteString& key, bool bValue); 68 void SetBooleanFor(const CFX_ByteString& key, bool bValue);
74 69
75 // Invalidates iterators for the element with the key |key|. 70 // Invalidates iterators for the element with the key |key|.
76 void RemoveFor(const CFX_ByteString& key); 71 void RemoveFor(const CFX_ByteString& key);
77 72
78 // Invalidates iterators for the element with the key |oldkey|. 73 // Invalidates iterators for the element with the key |oldkey|.
79 void ReplaceKey(const CFX_ByteString& oldkey, const CFX_ByteString& newkey); 74 void ReplaceKey(const CFX_ByteString& oldkey, const CFX_ByteString& newkey);
80 75
81 iterator begin() { return m_Map.begin(); } 76 iterator begin() { return m_Map.begin(); }
82 iterator end() { return m_Map.end(); } 77 iterator end() { return m_Map.end(); }
83 const_iterator begin() const { return m_Map.begin(); } 78 const_iterator begin() const { return m_Map.begin(); }
84 const_iterator end() const { return m_Map.end(); } 79 const_iterator end() const { return m_Map.end(); }
85 80
86 protected: 81 protected:
87 ~CPDF_Dictionary() override; 82 ~CPDF_Dictionary() override;
88 83
89 CPDF_Object* CloneNonCyclic( 84 CPDF_Object* CloneNonCyclic(
90 bool bDirect, 85 bool bDirect,
91 std::set<const CPDF_Object*>* visited) const override; 86 std::set<const CPDF_Object*>* visited) const override;
92 87
93 std::map<CFX_ByteString, CPDF_Object*> m_Map; 88 std::map<CFX_ByteString, CPDF_Object*> m_Map;
94 }; 89 };
95 90
96 #endif // CORE_FPDFAPI_FPDF_PARSER_INCLUDE_CPDF_DICTIONARY_H_ 91 #endif // CORE_FPDFAPI_FPDF_PARSER_INCLUDE_CPDF_DICTIONARY_H_
OLDNEW
« no previous file with comments | « core/fpdfapi/fpdf_parser/include/cpdf_array.h ('k') | core/fpdfdoc/cpdf_formfield_unittest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698