diff options
author | Henrique Nakashima <hnakashima@chromium.org> | 2017-08-01 19:47:24 -0400 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-08-02 16:02:53 +0000 |
commit | aea80dcc0abc0c310316fa502f91a359bc684758 (patch) | |
tree | b431624ce24b261c93fe6963b5ed14b101ff2e1b /core/fpdfapi/parser | |
parent | 33dd830890d38f9083b732cd908ef082f1d89d65 (diff) | |
download | pdfium-aea80dcc0abc0c310316fa502f91a359bc684758.tar.xz |
Remove CFX_ByteTextBuf from cpdfsdk_interform.cpp and others.
Bug: pdfium:731
Change-Id: I61d38ab3f2b0ac68b8479ade25bab50f3a73c27b
Reviewed-on: https://pdfium-review.googlesource.com/9770
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
Diffstat (limited to 'core/fpdfapi/parser')
-rw-r--r-- | core/fpdfapi/parser/cfdf_document.cpp | 9 | ||||
-rw-r--r-- | core/fpdfapi/parser/cfdf_document.h | 2 |
2 files changed, 7 insertions, 4 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); } diff --git a/core/fpdfapi/parser/cfdf_document.h b/core/fpdfapi/parser/cfdf_document.h index 9a13877544..45bf83d426 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; - bool WriteBuf(CFX_ByteTextBuf& buf) const; + CFX_ByteString WriteToString() const; CPDF_Dictionary* GetRoot() const { return m_pRootDict.Get(); } protected: |