summaryrefslogtreecommitdiff
path: root/core/fpdfapi/edit
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2018-08-23 23:52:53 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-08-23 23:52:53 +0000
commit367ed462b51799c008795b19e886ccbed221b9be (patch)
tree3c94f25900ec5617954dbfd3e615e6a4751ddfcd /core/fpdfapi/edit
parentc1dde5d9b3da2af6e6f81df09ed41ab9c34bbde4 (diff)
downloadpdfium-367ed462b51799c008795b19e886ccbed221b9be.tar.xz
Use pdfium::span<> in CPDF_Stream::SetData().
Conversion to span makes this more elegant in a number of places, owing to std::vector directly converting to span, and the bytestring's ToRawSpan(). Disambiguate single-argument forms to allow passing {} as an argument. Change-Id: Ibd5eaadca8d8cbbd589338f375c7ee8439fd3eb2 Reviewed-on: https://pdfium-review.googlesource.com/41272 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'core/fpdfapi/edit')
-rw-r--r--core/fpdfapi/edit/cpdf_pagecontentgenerator.cpp2
-rw-r--r--core/fpdfapi/edit/cpdf_pagecontentmanager.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/core/fpdfapi/edit/cpdf_pagecontentgenerator.cpp b/core/fpdfapi/edit/cpdf_pagecontentgenerator.cpp
index e2fa801a58..ea1a1956ae 100644
--- a/core/fpdfapi/edit/cpdf_pagecontentgenerator.cpp
+++ b/core/fpdfapi/edit/cpdf_pagecontentgenerator.cpp
@@ -176,7 +176,7 @@ void CPDF_PageContentGenerator::UpdateContentStreams(
if (buf->tellp() <= 0)
page_content_manager.ScheduleRemoveStreamByIndex(stream_index);
else
- old_stream->SetData(buf);
+ old_stream->SetDataFromStringstream(buf);
}
page_content_manager.ExecuteScheduledRemovals();
diff --git a/core/fpdfapi/edit/cpdf_pagecontentmanager.cpp b/core/fpdfapi/edit/cpdf_pagecontentmanager.cpp
index b635144b36..b3fe4ae39a 100644
--- a/core/fpdfapi/edit/cpdf_pagecontentmanager.cpp
+++ b/core/fpdfapi/edit/cpdf_pagecontentmanager.cpp
@@ -60,7 +60,7 @@ CPDF_Stream* CPDF_PageContentManager::GetStreamByIndex(size_t stream_index) {
size_t CPDF_PageContentManager::AddStream(std::ostringstream* buf) {
CPDF_Stream* new_stream = doc_->NewIndirect<CPDF_Stream>();
- new_stream->SetData(buf);
+ new_stream->SetDataFromStringstream(buf);
// If there is one Content stream (not in an array), now there will be two, so
// create an array with the old and the new one. The new one's index is 1.