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/fpdf_annot.cpp | |
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/fpdf_annot.cpp')
-rw-r--r-- | fpdfsdk/fpdf_annot.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
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<CPDF_Stream>(); - pNewApStream->SetData(newValue.raw_str(), newValue.GetLength()); + pNewApStream->SetData(newValue.AsRawSpan()); pApDict->SetFor(modeKey, std::move(pNewApStream)); } else { if (pApDict) { |