diff options
author | Tom Sepez <tsepez@chromium.org> | 2018-08-23 23:52:53 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-08-23 23:52:53 +0000 |
commit | 367ed462b51799c008795b19e886ccbed221b9be (patch) | |
tree | 3c94f25900ec5617954dbfd3e615e6a4751ddfcd /fpdfsdk/pwl | |
parent | c1dde5d9b3da2af6e6f81df09ed41ab9c34bbde4 (diff) | |
download | pdfium-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 'fpdfsdk/pwl')
-rw-r--r-- | fpdfsdk/pwl/cpwl_appstream.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fpdfsdk/pwl/cpwl_appstream.cpp b/fpdfsdk/pwl/cpwl_appstream.cpp index 512af1437a..7d7f710f03 100644 --- a/fpdfsdk/pwl/cpwl_appstream.cpp +++ b/fpdfsdk/pwl/cpwl_appstream.cpp @@ -1948,11 +1948,11 @@ void CPWL_AppStream::Write(const ByteString& sAPType, pStreamDict->SetNewFor<CPDF_Name>("Type", "XObject"); pStreamDict->SetNewFor<CPDF_Name>("Subtype", "Form"); pStreamDict->SetNewFor<CPDF_Number>("FormType", 1); - pStream->InitStream(nullptr, 0, std::move(pNewDict)); + pStream->InitStream({}, std::move(pNewDict)); } pStreamDict->SetMatrixFor("Matrix", widget_->GetMatrix()); pStreamDict->SetRectFor("BBox", widget_->GetRotatedRect()); - pStream->SetDataAndRemoveFilter(sContents.raw_str(), sContents.GetLength()); + pStream->SetDataAndRemoveFilter(sContents.AsRawSpan()); } void CPWL_AppStream::Remove(const ByteString& sAPType) { |