summaryrefslogtreecommitdiff
path: root/core/fpdfapi/parser/cfdf_document.cpp
diff options
context:
space:
mode:
authorHenrique Nakashima <hnakashima@chromium.org>2017-08-04 12:28:52 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-08-04 16:48:53 +0000
commit5c09f4ca825652f910d3ff406fcbf64d25f56e23 (patch)
tree9af51506fcc914244bc682878801b8d362f6cfdd /core/fpdfapi/parser/cfdf_document.cpp
parenta2da7c5612f1fa26dde508da2a527a4bab381de0 (diff)
downloadpdfium-5c09f4ca825652f910d3ff406fcbf64d25f56e23.tar.xz
Remove CFX_ByteTextBuf from cpdfsdk_interform.cpp and others.chromium/3177
New version of the CL that include fpdf_parser_utility.cpp where there is an overload for CFX_ByteTextBuf << CPDF_Object* used by CFDF_Document. Bug: pdfium:731 Change-Id: I54f4e9ee7e10e94388f6f6584f3999f43689e84c Reviewed-on: https://pdfium-review.googlesource.com/10170 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
Diffstat (limited to 'core/fpdfapi/parser/cfdf_document.cpp')
-rw-r--r--core/fpdfapi/parser/cfdf_document.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/core/fpdfapi/parser/cfdf_document.cpp b/core/fpdfapi/parser/cfdf_document.cpp
index 85e2f6ef04..b00806967b 100644
--- a/core/fpdfapi/parser/cfdf_document.cpp
+++ b/core/fpdfapi/parser/cfdf_document.cpp
@@ -7,6 +7,7 @@
#include "core/fpdfapi/parser/cfdf_document.h"
#include <memory>
+#include <sstream>
#include <utility>
#include "core/fpdfapi/edit/cpdf_creator.h"
@@ -88,10 +89,11 @@ void CFDF_Document::ParseStream(
}
}
-bool CFDF_Document::WriteBuf(CFX_ByteTextBuf& buf) const {
+CFX_ByteString CFDF_Document::WriteToString() const {
if (!m_pRootDict)
- return false;
+ return CFX_ByteString();
+ std::ostringstream buf;
buf << "%FDF-1.2\r\n";
for (const auto& pair : *this)
buf << pair.first << " 0 obj\r\n"
@@ -99,5 +101,6 @@ bool CFDF_Document::WriteBuf(CFX_ByteTextBuf& buf) const {
buf << "trailer\r\n<</Root " << m_pRootDict->GetObjNum()
<< " 0 R>>\r\n%%EOF\r\n";
- return true;
+
+ return CFX_ByteString(buf);
}