From 596fc4c034b70e7826d4781432e4b657921f1abc Mon Sep 17 00:00:00 2001 From: tsepez Date: Tue, 7 Jun 2016 06:41:50 -0700 Subject: Add missing const to CPDF_Stream::InitStream() Review-Url: https://codereview.chromium.org/2044453003 --- core/fpdfapi/fpdf_edit/cpdf_pagecontentgenerator.cpp | 2 +- core/fpdfapi/fpdf_parser/cpdf_stream.cpp | 2 +- core/fpdfapi/fpdf_parser/include/cpdf_stream.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/fpdfapi/fpdf_edit/cpdf_pagecontentgenerator.cpp b/core/fpdfapi/fpdf_edit/cpdf_pagecontentgenerator.cpp index 08bdb5bb07..2907ebe71c 100644 --- a/core/fpdfapi/fpdf_edit/cpdf_pagecontentgenerator.cpp +++ b/core/fpdfapi/fpdf_edit/cpdf_pagecontentgenerator.cpp @@ -115,7 +115,7 @@ void CPDF_PageContentGenerator::ProcessForm(CFX_ByteTextBuf& buf, CFX_FloatRect bbox = m_pPage->GetPageBBox(); matrix.TransformRect(bbox); pFormDict->SetAtRect("BBox", bbox); - pStream->InitStream((uint8_t*)data, size, pFormDict); + pStream->InitStream(data, size, pFormDict); buf << "q " << matrix << " cm "; CFX_ByteString name = RealizeResource(pStream, "XObject"); buf << "/" << PDF_NameEncode(name) << " Do Q\n"; diff --git a/core/fpdfapi/fpdf_parser/cpdf_stream.cpp b/core/fpdfapi/fpdf_parser/cpdf_stream.cpp index 108f487602..7e65c25533 100644 --- a/core/fpdfapi/fpdf_parser/cpdf_stream.cpp +++ b/core/fpdfapi/fpdf_parser/cpdf_stream.cpp @@ -57,7 +57,7 @@ void CPDF_Stream::InitStreamInternal(CPDF_Dictionary* pDict) { m_pFile = nullptr; } -void CPDF_Stream::InitStream(uint8_t* pData, +void CPDF_Stream::InitStream(const uint8_t* pData, uint32_t size, CPDF_Dictionary* pDict) { InitStreamInternal(pDict); diff --git a/core/fpdfapi/fpdf_parser/include/cpdf_stream.h b/core/fpdfapi/fpdf_parser/include/cpdf_stream.h index 0010a1528e..6aa8bca8dc 100644 --- a/core/fpdfapi/fpdf_parser/include/cpdf_stream.h +++ b/core/fpdfapi/fpdf_parser/include/cpdf_stream.h @@ -32,7 +32,7 @@ class CPDF_Stream : public CPDF_Object { FX_BOOL bCompressed, FX_BOOL bKeepBuf); - void InitStream(uint8_t* pData, uint32_t size, CPDF_Dictionary* pDict); + void InitStream(const uint8_t* pData, uint32_t size, CPDF_Dictionary* pDict); void InitStreamFromFile(IFX_FileRead* pFile, CPDF_Dictionary* pDict); FX_BOOL ReadRawData(FX_FILESIZE start_pos, -- cgit v1.2.3