From 367ed462b51799c008795b19e886ccbed221b9be Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Thu, 23 Aug 2018 23:52:53 +0000 Subject: 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 Commit-Queue: Tom Sepez --- fpdfsdk/pwl/cpwl_appstream.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'fpdfsdk/pwl') 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("Type", "XObject"); pStreamDict->SetNewFor("Subtype", "Form"); pStreamDict->SetNewFor("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) { -- cgit v1.2.3