summaryrefslogtreecommitdiff
path: root/core/fxcrt/cfx_bytestring.cpp
diff options
context:
space:
mode:
authorHenrique Nakashima <hnakashima@chromium.org>2017-08-09 14:10:02 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-08-10 14:40:52 +0000
commite6c67cd64a80bd67c587ad3ffb380fe1b7574d1f (patch)
tree14f27ef6173fc1585a5d295f57fe4e517330a009 /core/fxcrt/cfx_bytestring.cpp
parent4454ce7c74558f610962c6d41d446f50875603ad (diff)
downloadpdfium-e6c67cd64a80bd67c587ad3ffb380fe1b7574d1f.tar.xz
Make CFX_ByteString(ostringstream) const.
Change-Id: I782379cc7f93b93ed34a5d0a39ee2f198c650465 Reviewed-on: https://pdfium-review.googlesource.com/10430 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
Diffstat (limited to 'core/fxcrt/cfx_bytestring.cpp')
-rw-r--r--core/fxcrt/cfx_bytestring.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/core/fxcrt/cfx_bytestring.cpp b/core/fxcrt/cfx_bytestring.cpp
index f6634fc51d..c29d24affd 100644
--- a/core/fxcrt/cfx_bytestring.cpp
+++ b/core/fxcrt/cfx_bytestring.cpp
@@ -10,6 +10,7 @@
#include <algorithm>
#include <cctype>
+#include <string>
#include "core/fxcrt/cfx_string_pool_template.h"
#include "core/fxcrt/fx_codepage.h"
@@ -195,9 +196,11 @@ CFX_ByteString::CFX_ByteString(
}
}
-CFX_ByteString::CFX_ByteString(std::ostringstream& outStream)
- : CFX_ByteString(outStream.str().c_str(),
- static_cast<int>(outStream.tellp())) {}
+CFX_ByteString::CFX_ByteString(const std::ostringstream& outStream) {
+ std::string str = outStream.str();
+ if (str.length() > 0)
+ m_pData.Reset(StringData::Create(str.c_str(), str.length()));
+}
CFX_ByteString::~CFX_ByteString() {}