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

Unified Diff: core/fpdfapi/parser/cpdf_dictionary.cpp

Issue 2403143002: Add method to convert an indirect object in a dictionary (Closed)
Patch Set: Const ref 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « core/fpdfapi/parser/cpdf_dictionary.h ('k') | core/fpdfapi/parser/cpdf_object_unittest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fpdfapi/parser/cpdf_dictionary.cpp
diff --git a/core/fpdfapi/parser/cpdf_dictionary.cpp b/core/fpdfapi/parser/cpdf_dictionary.cpp
index 31f520af0de82771ca77f39d48702f0a91c2a2e7..2aa5248be0a284039411abb36e5c248515f53eef 100644
--- a/core/fpdfapi/parser/cpdf_dictionary.cpp
+++ b/core/fpdfapi/parser/cpdf_dictionary.cpp
@@ -192,6 +192,17 @@ void CPDF_Dictionary::SetFor(const CFX_ByteString& key, CPDF_Object* pObj) {
m_Map.erase(it);
}
+void CPDF_Dictionary::ConvertToIndirectObjectFor(
+ const CFX_ByteString& key,
+ CPDF_IndirectObjectHolder* pHolder) {
+ auto it = m_Map.find(key);
+ if (it == m_Map.end() || it->second->IsReference())
+ return;
+
+ uint32_t objnum = pHolder->AddIndirectObject(it->second);
+ it->second = new CPDF_Reference(pHolder, objnum);
+}
+
void CPDF_Dictionary::RemoveFor(const CFX_ByteString& key) {
auto it = m_Map.find(key);
if (it == m_Map.end())
« no previous file with comments | « core/fpdfapi/parser/cpdf_dictionary.h ('k') | core/fpdfapi/parser/cpdf_object_unittest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698