From 30029419ad4b9e5cd382767a8645677afbeff7fd Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Mon, 13 Aug 2018 19:56:29 +0000 Subject: Use CFX_ReadOnlyMemoryStream in more places. More const pointers, less const_casts. BUG=pdfium:263 Change-Id: I47fc6d8f2f837390e40ad22d8b67946065294eaa Reviewed-on: https://pdfium-review.googlesource.com/39879 Reviewed-by: Tom Sepez Commit-Queue: Lei Zhang --- xfa/fxfa/cxfa_ffdoc.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'xfa/fxfa/cxfa_ffdoc.cpp') diff --git a/xfa/fxfa/cxfa_ffdoc.cpp b/xfa/fxfa/cxfa_ffdoc.cpp index 330572ff9c..7852d30036 100644 --- a/xfa/fxfa/cxfa_ffdoc.cpp +++ b/xfa/fxfa/cxfa_ffdoc.cpp @@ -14,7 +14,7 @@ #include "core/fpdfapi/parser/cpdf_document.h" #include "core/fpdfapi/parser/fpdf_parser_decode.h" #include "core/fpdfdoc/cpdf_nametree.h" -#include "core/fxcrt/cfx_memorystream.h" +#include "core/fxcrt/cfx_readonlymemorystream.h" #include "core/fxcrt/cfx_seekablemultistream.h" #include "core/fxcrt/fx_extension.h" #include "core/fxcrt/fx_memory.h" @@ -215,9 +215,8 @@ RetainPtr CXFA_FFDoc::GetPDFNamedImage( auto pAcc = pdfium::MakeRetain(pStream); pAcc->LoadAllDataFiltered(); - RetainPtr pImageFileRead = - pdfium::MakeRetain( - const_cast(pAcc->GetData()), pAcc->GetSize(), false); + auto pImageFileRead = pdfium::MakeRetain( + pAcc->GetData(), pAcc->GetSize()); RetainPtr pDibSource = XFA_LoadImageFromBuffer( pImageFileRead, FXCODEC_IMAGE_UNKNOWN, iImageXDpi, iImageYDpi); -- cgit v1.2.3