From 987f3ee94c3cb8e4a6113ad05453a2948469386c Mon Sep 17 00:00:00 2001 From: tsepez Date: Fri, 26 Aug 2016 15:17:12 -0700 Subject: Make CFX_CountRef<>::m_pObject private, add accessors, fix const-ness. Hide the CountedObj class from the rest of the code. Rename GetModify() to GetPrivateCopy(), since it turns out there are places where we modify a potentially-shared copy. Add non-const version of GetObject() to permit these. Review-Url: https://codereview.chromium.org/2287633002 --- fpdfsdk/fpdfeditimg.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'fpdfsdk/fpdfeditimg.cpp') diff --git a/fpdfsdk/fpdfeditimg.cpp b/fpdfsdk/fpdfeditimg.cpp index da3d33eb05..1fe832b877 100644 --- a/fpdfsdk/fpdfeditimg.cpp +++ b/fpdfsdk/fpdfeditimg.cpp @@ -33,7 +33,7 @@ FPDFImageObj_LoadJpegFile(FPDF_PAGE* pages, IFX_FileRead* pFile = new CPDF_CustomAccess(fileAccess); CPDF_ImageObject* pImgObj = reinterpret_cast(image_object); - pImgObj->m_GeneralState.GetModify(); + pImgObj->m_GeneralState.GetPrivateCopy(); for (int index = 0; index < nCount; index++) { CPDF_Page* pPage = CPDFPageFromFPDFPage(pages[index]); if (pPage) @@ -73,7 +73,7 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFImageObj_SetBitmap(FPDF_PAGE* pages, return FALSE; CPDF_ImageObject* pImgObj = reinterpret_cast(image_object); - pImgObj->m_GeneralState.GetModify(); + pImgObj->m_GeneralState.GetPrivateCopy(); for (int index = 0; index < nCount; index++) { CPDF_Page* pPage = CPDFPageFromFPDFPage(pages[index]); if (pPage) -- cgit v1.2.3