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/fpdf_annot.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'fpdfsdk/fpdf_annot.cpp') diff --git a/fpdfsdk/fpdf_annot.cpp b/fpdfsdk/fpdf_annot.cpp index 070a7fd78e..b20e5c87dc 100644 --- a/fpdfsdk/fpdf_annot.cpp +++ b/fpdfsdk/fpdf_annot.cpp @@ -153,7 +153,7 @@ void UpdateContentStream(CPDF_Form* pForm, CPDF_Stream* pStream) { CPDF_PageContentGenerator generator(pForm); std::ostringstream buf; generator.ProcessPageObjects(&buf); - pStream->SetDataAndRemoveFilter(&buf); + pStream->SetDataFromStringstreamAndRemoveFilter(&buf); } void SetQuadPointsAtIndex(CPDF_Array* array, @@ -784,7 +784,7 @@ FPDFAnnot_SetAP(FPDF_ANNOTATION annot, ByteString newValue = CFXByteStringFromFPDFWideString(value); auto pNewApStream = pdfium::MakeUnique(); - pNewApStream->SetData(newValue.raw_str(), newValue.GetLength()); + pNewApStream->SetData(newValue.AsRawSpan()); pApDict->SetFor(modeKey, std::move(pNewApStream)); } else { if (pApDict) { -- cgit v1.2.3