summaryrefslogtreecommitdiff
path: root/core/fpdfapi/parser/cpdf_reference.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/fpdfapi/parser/cpdf_reference.cpp')
-rw-r--r--core/fpdfapi/parser/cpdf_reference.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/core/fpdfapi/parser/cpdf_reference.cpp b/core/fpdfapi/parser/cpdf_reference.cpp
index 942bae58ba..560fd27934 100644
--- a/core/fpdfapi/parser/cpdf_reference.cpp
+++ b/core/fpdfapi/parser/cpdf_reference.cpp
@@ -82,3 +82,16 @@ CPDF_Object* CPDF_Reference::GetDirect() const {
return m_pObjList ? m_pObjList->GetOrParseIndirectObject(m_RefObjNum)
: nullptr;
}
+
+bool CPDF_Reference::WriteTo(CFX_FileBufferArchive* archive,
+ FX_FILESIZE* offset) const {
+ if (archive->AppendString(" ") < 0)
+ return false;
+ int32_t len = archive->AppendDWord(GetRefObjNum());
+ if (len < 0)
+ return false;
+ if (archive->AppendString(" 0 R ") < 0)
+ return false;
+ *offset += len + 6;
+ return true;
+}