summaryrefslogtreecommitdiff
path: root/core/fpdfapi/parser/cpdf_dictionary.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/fpdfapi/parser/cpdf_dictionary.cpp')
-rw-r--r--core/fpdfapi/parser/cpdf_dictionary.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/core/fpdfapi/parser/cpdf_dictionary.cpp b/core/fpdfapi/parser/cpdf_dictionary.cpp
index 7ef5a53551..54aafd43b1 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())