summaryrefslogtreecommitdiff
path: root/core/fpdfapi
diff options
context:
space:
mode:
Diffstat (limited to 'core/fpdfapi')
-rw-r--r--core/fpdfapi/parser/cfdf_document.cpp9
-rw-r--r--core/fpdfapi/parser/cfdf_document.h2
2 files changed, 4 insertions, 7 deletions
diff --git a/core/fpdfapi/parser/cfdf_document.cpp b/core/fpdfapi/parser/cfdf_document.cpp
index b00806967b..85e2f6ef04 100644
--- a/core/fpdfapi/parser/cfdf_document.cpp
+++ b/core/fpdfapi/parser/cfdf_document.cpp
@@ -7,7 +7,6 @@
#include "core/fpdfapi/parser/cfdf_document.h"
#include <memory>
-#include <sstream>
#include <utility>
#include "core/fpdfapi/edit/cpdf_creator.h"
@@ -89,11 +88,10 @@ void CFDF_Document::ParseStream(
}
}
-CFX_ByteString CFDF_Document::WriteToString() const {
+bool CFDF_Document::WriteBuf(CFX_ByteTextBuf& buf) const {
if (!m_pRootDict)
- return CFX_ByteString();
+ return false;
- std::ostringstream buf;
buf << "%FDF-1.2\r\n";
for (const auto& pair : *this)
buf << pair.first << " 0 obj\r\n"
@@ -101,6 +99,5 @@ CFX_ByteString CFDF_Document::WriteToString() const {
buf << "trailer\r\n<</Root " << m_pRootDict->GetObjNum()
<< " 0 R>>\r\n%%EOF\r\n";
-
- return CFX_ByteString(buf);
+ return true;
}
diff --git a/core/fpdfapi/parser/cfdf_document.h b/core/fpdfapi/parser/cfdf_document.h
index 45bf83d426..9a13877544 100644
--- a/core/fpdfapi/parser/cfdf_document.h
+++ b/core/fpdfapi/parser/cfdf_document.h
@@ -27,7 +27,7 @@ class CFDF_Document : public CPDF_IndirectObjectHolder {
CFDF_Document();
~CFDF_Document() override;
- CFX_ByteString WriteToString() const;
+ bool WriteBuf(CFX_ByteTextBuf& buf) const;
CPDF_Dictionary* GetRoot() const { return m_pRootDict.Get(); }
protected: