summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorHenrique Nakashima <hnakashima@chromium.org>2017-08-04 15:41:58 +0000
committerChromium commit bot <commit-bot@chromium.org>2017-08-04 15:57:24 +0000
commit1952d17428ba5d509dc21cd8d49abba1bd2d2c5d (patch)
treebf3ec6ae6b2c69bd8636b4b3f4c0b9e8101c68fc /core
parent6061c4167a690308e91ae0c99515c7c9e6380c99 (diff)
downloadpdfium-1952d17428ba5d509dc21cd8d49abba1bd2d2c5d.tar.xz
Revert "Remove CFX_ByteTextBuf from cpdfsdk_interform.cpp and others."
This reverts commit aea80dcc0abc0c310316fa502f91a359bc684758. Reason for revert: WriteBuf's behavior was altered Original change's description: > 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> TBR=tsepez@chromium.org,hnakashima@chromium.org,rharrison@chromium.org # Not skipping CQ checks because original CL landed > 1 day ago. Bug: pdfium:731 Change-Id: Ic66a2641c259173fb3792f7a4206e19ee4707fc9 Reviewed-on: https://pdfium-review.googlesource.com/10150 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
Diffstat (limited to 'core')
-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: