summaryrefslogtreecommitdiff
path: root/core/fpdfapi/parser/cpdf_number.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/fpdfapi/parser/cpdf_number.cpp')
-rw-r--r--core/fpdfapi/parser/cpdf_number.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/core/fpdfapi/parser/cpdf_number.cpp b/core/fpdfapi/parser/cpdf_number.cpp
index c83b9dcd38..24665fff60 100644
--- a/core/fpdfapi/parser/cpdf_number.cpp
+++ b/core/fpdfapi/parser/cpdf_number.cpp
@@ -55,3 +55,15 @@ CFX_ByteString CPDF_Number::GetString() const {
return m_bInteger ? CFX_ByteString::FormatInteger(m_Integer, FXFORMAT_SIGNED)
: CFX_ByteString::FormatFloat(m_Float);
}
+
+bool CPDF_Number::WriteTo(CFX_FileBufferArchive* archive,
+ FX_FILESIZE* offset) const {
+ if (archive->AppendString(" ") < 0)
+ return false;
+
+ int32_t len = archive->AppendString(GetString().AsStringC());
+ if (len < 0)
+ return false;
+ *offset += len + 1;
+ return true;
+}