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_edittext.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'fpdfsdk/fpdf_edittext.cpp') diff --git a/fpdfsdk/fpdf_edittext.cpp b/fpdfsdk/fpdf_edittext.cpp index 2773763b9a..4dc293be8a 100644 --- a/fpdfsdk/fpdf_edittext.cpp +++ b/fpdfsdk/fpdf_edittext.cpp @@ -94,7 +94,7 @@ CPDF_Dictionary* LoadFontDesc(CPDF_Document* pDoc, pFontDesc->SetNewFor("StemV", pFont->IsBold() ? 120 : 70); CPDF_Stream* pStream = pDoc->NewIndirect(); - pStream->SetData(data, size); + pStream->SetData({data, size}); // TODO(npm): Lengths for Type1 fonts. if (font_type == FPDF_FONT_TRUETYPE) { pStream->GetDict()->SetNewFor("Length1", @@ -256,7 +256,7 @@ CPDF_Stream* LoadUnicode(CPDF_Document* pDoc, buffer << ToUnicodeEnd; // TODO(npm): Encrypt / Compress? CPDF_Stream* stream = pDoc->NewIndirect(); - stream->SetData(&buffer); + stream->SetDataFromStringstream(&buffer); return stream; } -- cgit v1.2.3