summaryrefslogtreecommitdiff
path: root/fpdfsdk/fpdf_edittext.cpp
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2018-08-23 23:52:53 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-08-23 23:52:53 +0000
commit367ed462b51799c008795b19e886ccbed221b9be (patch)
tree3c94f25900ec5617954dbfd3e615e6a4751ddfcd /fpdfsdk/fpdf_edittext.cpp
parentc1dde5d9b3da2af6e6f81df09ed41ab9c34bbde4 (diff)
downloadpdfium-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_edittext.cpp')
-rw-r--r--fpdfsdk/fpdf_edittext.cpp4
1 files changed, 2 insertions, 2 deletions
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<CPDF_Number>("StemV", pFont->IsBold() ? 120 : 70);
CPDF_Stream* pStream = pDoc->NewIndirect<CPDF_Stream>();
- pStream->SetData(data, size);
+ pStream->SetData({data, size});
// TODO(npm): Lengths for Type1 fonts.
if (font_type == FPDF_FONT_TRUETYPE) {
pStream->GetDict()->SetNewFor<CPDF_Number>("Length1",
@@ -256,7 +256,7 @@ CPDF_Stream* LoadUnicode(CPDF_Document* pDoc,
buffer << ToUnicodeEnd;
// TODO(npm): Encrypt / Compress?
CPDF_Stream* stream = pDoc->NewIndirect<CPDF_Stream>();
- stream->SetData(&buffer);
+ stream->SetDataFromStringstream(&buffer);
return stream;
}