summaryrefslogtreecommitdiff
path: root/fpdfsdk
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk')
-rw-r--r--fpdfsdk/cpdfsdk_formfillenvironment.cpp4
-rw-r--r--fpdfsdk/cpdfsdk_formfillenvironment.h2
-rw-r--r--fpdfsdk/cpdfsdk_pageview.cpp2
-rw-r--r--fpdfsdk/fpdf_dataavail.cpp6
-rw-r--r--fpdfsdk/fpdf_progressive.cpp2
-rw-r--r--fpdfsdk/fpdfeditimg.cpp19
-rw-r--r--fpdfsdk/fpdfformfill.cpp2
-rw-r--r--fpdfsdk/fpdfsave.cpp18
-rw-r--r--fpdfsdk/fpdfview.cpp54
-rw-r--r--fpdfsdk/fpdfxfa/cpdfxfa_context.cpp6
-rw-r--r--fpdfsdk/fpdfxfa/cpdfxfa_context.h10
-rw-r--r--fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp25
-rw-r--r--fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.h4
-rw-r--r--fpdfsdk/fpdfxfa/cpdfxfa_page.h6
-rw-r--r--fpdfsdk/fsdk_define.h4
-rw-r--r--fpdfsdk/fsdk_filewriteadapter.h4
16 files changed, 81 insertions, 87 deletions
diff --git a/fpdfsdk/cpdfsdk_formfillenvironment.cpp b/fpdfsdk/cpdfsdk_formfillenvironment.cpp
index 300a742809..9e65b46f44 100644
--- a/fpdfsdk/cpdfsdk_formfillenvironment.cpp
+++ b/fpdfsdk/cpdfsdk_formfillenvironment.cpp
@@ -441,8 +441,8 @@ FPDF_FILEHANDLER* CPDFSDK_FormFillEnvironment::OpenFile(int fileType,
return nullptr;
}
-CFX_RetainPtr<IFX_SeekableReadStream>
-CPDFSDK_FormFillEnvironment::DownloadFromURL(const wchar_t* url) {
+RetainPtr<IFX_SeekableReadStream> CPDFSDK_FormFillEnvironment::DownloadFromURL(
+ const wchar_t* url) {
if (!m_pInfo || !m_pInfo->FFI_DownloadFromURL)
return nullptr;
diff --git a/fpdfsdk/cpdfsdk_formfillenvironment.h b/fpdfsdk/cpdfsdk_formfillenvironment.h
index ea7b3c7e38..d6f7088c1f 100644
--- a/fpdfsdk/cpdfsdk_formfillenvironment.h
+++ b/fpdfsdk/cpdfsdk_formfillenvironment.h
@@ -156,7 +156,7 @@ class CPDFSDK_FormFillEnvironment
FPDF_FILEHANDLER* OpenFile(int fileType,
FPDF_WIDESTRING wsURL,
const char* mode);
- CFX_RetainPtr<IFX_SeekableReadStream> DownloadFromURL(const wchar_t* url);
+ RetainPtr<IFX_SeekableReadStream> DownloadFromURL(const wchar_t* url);
WideString PostRequestURL(const wchar_t* wsURL,
const wchar_t* wsData,
const wchar_t* wsContentType,
diff --git a/fpdfsdk/cpdfsdk_pageview.cpp b/fpdfsdk/cpdfsdk_pageview.cpp
index a8dc88c7d6..bdde975267 100644
--- a/fpdfsdk/cpdfsdk_pageview.cpp
+++ b/fpdfsdk/cpdfsdk_pageview.cpp
@@ -426,7 +426,7 @@ void CPDFSDK_PageView::LoadFXAnnots() {
m_bLocked = true;
#ifdef PDF_ENABLE_XFA
- CFX_RetainPtr<CPDFXFA_Page> protector(m_page);
+ RetainPtr<CPDFXFA_Page> protector(m_page);
if (m_pFormFillEnv->GetXFAContext()->GetDocType() == XFA_DocType::Dynamic) {
CXFA_FFPageView* pageView = m_page->GetXFAPageView();
std::unique_ptr<IXFA_WidgetIterator> pWidgetHandler(
diff --git a/fpdfsdk/fpdf_dataavail.cpp b/fpdfsdk/fpdf_dataavail.cpp
index e659db7be1..7232def75d 100644
--- a/fpdfsdk/fpdf_dataavail.cpp
+++ b/fpdfsdk/fpdf_dataavail.cpp
@@ -11,8 +11,8 @@
#include "core/fpdfapi/parser/cpdf_data_avail.h"
#include "core/fpdfapi/parser/cpdf_document.h"
-#include "core/fxcrt/cfx_retain_ptr.h"
#include "core/fxcrt/fx_stream.h"
+#include "core/fxcrt/retain_ptr.h"
#include "fpdfsdk/fsdk_define.h"
#include "public/fpdf_formfill.h"
#include "third_party/base/ptr_util.h"
@@ -62,7 +62,7 @@ class CFPDF_FileAvailWrap : public CPDF_DataAvail::FileAvail {
class CFPDF_FileAccessWrap : public IFX_SeekableReadStream {
public:
template <typename T, typename... Args>
- friend CFX_RetainPtr<T> pdfium::MakeRetain(Args&&... args);
+ friend RetainPtr<T> pdfium::MakeRetain(Args&&... args);
~CFPDF_FileAccessWrap() override {}
@@ -107,7 +107,7 @@ class CFPDF_DataAvail {
~CFPDF_DataAvail() {}
std::unique_ptr<CFPDF_FileAvailWrap> m_FileAvail;
- CFX_RetainPtr<CFPDF_FileAccessWrap> m_FileRead;
+ RetainPtr<CFPDF_FileAccessWrap> m_FileRead;
std::unique_ptr<CPDF_DataAvail> m_pDataAvail;
};
diff --git a/fpdfsdk/fpdf_progressive.cpp b/fpdfsdk/fpdf_progressive.cpp
index c52f3707cc..730ba48162 100644
--- a/fpdfsdk/fpdf_progressive.cpp
+++ b/fpdfsdk/fpdf_progressive.cpp
@@ -50,7 +50,7 @@ FPDF_EXPORT int FPDF_CALLCONV FPDF_RenderPageBitmap_Start(FPDF_BITMAP bitmap,
CPDF_PageRenderContext* pContext = pOwnedContext.get();
pPage->SetRenderContext(std::move(pOwnedContext));
- CFX_RetainPtr<CFX_DIBitmap> pBitmap(CFXBitmapFromFPDFBitmap(bitmap));
+ RetainPtr<CFX_DIBitmap> pBitmap(CFXBitmapFromFPDFBitmap(bitmap));
auto pOwnedDevice = pdfium::MakeUnique<CFX_DefaultRenderDevice>();
CFX_DefaultRenderDevice* pDevice = pOwnedDevice.get();
pContext->m_pDevice = std::move(pOwnedDevice);
diff --git a/fpdfsdk/fpdfeditimg.cpp b/fpdfsdk/fpdfeditimg.cpp
index 7036aa2ffd..4842e35c76 100644
--- a/fpdfsdk/fpdfeditimg.cpp
+++ b/fpdfsdk/fpdfeditimg.cpp
@@ -51,8 +51,7 @@ bool LoadJpegHelper(FPDF_PAGE* pages,
if (!image_object || !fileAccess)
return false;
- CFX_RetainPtr<IFX_SeekableReadStream> pFile =
- MakeSeekableReadStream(fileAccess);
+ RetainPtr<IFX_SeekableReadStream> pFile = MakeSeekableReadStream(fileAccess);
CPDF_ImageObject* pImgObj = static_cast<CPDF_ImageObject*>(image_object);
if (pages) {
@@ -134,7 +133,7 @@ FPDFImageObj_SetBitmap(FPDF_PAGE* pages,
if (pPage)
pImgObj->GetImage()->ResetCache(pPage, nullptr);
}
- CFX_RetainPtr<CFX_DIBitmap> holder(CFXBitmapFromFPDFBitmap(bitmap));
+ RetainPtr<CFX_DIBitmap> holder(CFXBitmapFromFPDFBitmap(bitmap));
pImgObj->GetImage()->SetImage(holder);
pImgObj->CalcBoundingBox();
pImgObj->SetDirty(true);
@@ -147,15 +146,15 @@ FPDFImageObj_GetBitmap(FPDF_PAGEOBJECT image_object) {
if (!pObj || !pObj->IsImage())
return nullptr;
- CFX_RetainPtr<CPDF_Image> pImg = pObj->AsImage()->GetImage();
+ RetainPtr<CPDF_Image> pImg = pObj->AsImage()->GetImage();
if (!pImg)
return nullptr;
- CFX_RetainPtr<CFX_DIBSource> pSource = pImg->LoadDIBSource();
+ RetainPtr<CFX_DIBSource> pSource = pImg->LoadDIBSource();
if (!pSource)
return nullptr;
- CFX_RetainPtr<CFX_DIBitmap> pBitmap;
+ RetainPtr<CFX_DIBitmap> pBitmap;
// If the source image has a representation of 1 bit per pixel, then convert
// it to a grayscale bitmap having 1 byte per pixel, since bitmaps have no
// concept of bits. Otherwise, convert the source image to a bitmap directly,
@@ -176,7 +175,7 @@ FPDFImageObj_GetImageDataDecoded(FPDF_PAGEOBJECT image_object,
if (!pObj || !pObj->IsImage())
return 0;
- CFX_RetainPtr<CPDF_Image> pImg = pObj->AsImage()->GetImage();
+ RetainPtr<CPDF_Image> pImg = pObj->AsImage()->GetImage();
if (!pImg)
return 0;
@@ -195,7 +194,7 @@ FPDFImageObj_GetImageDataRaw(FPDF_PAGEOBJECT image_object,
if (!pObj || !pObj->IsImage())
return 0;
- CFX_RetainPtr<CPDF_Image> pImg = pObj->AsImage()->GetImage();
+ RetainPtr<CPDF_Image> pImg = pObj->AsImage()->GetImage();
if (!pImg)
return 0;
@@ -216,7 +215,7 @@ FPDFImageObj_GetImageFilterCount(FPDF_PAGEOBJECT image_object) {
if (!pObj || !pObj->IsImage())
return 0;
- CFX_RetainPtr<CPDF_Image> pImg = pObj->AsImage()->GetImage();
+ RetainPtr<CPDF_Image> pImg = pObj->AsImage()->GetImage();
if (!pImg)
return 0;
@@ -264,7 +263,7 @@ FPDFImageObj_GetImageMetadata(FPDF_PAGEOBJECT image_object,
if (!pObj || !pObj->IsImage() || !metadata)
return false;
- CFX_RetainPtr<CPDF_Image> pImg = pObj->AsImage()->GetImage();
+ RetainPtr<CPDF_Image> pImg = pObj->AsImage()->GetImage();
if (!pImg)
return false;
diff --git a/fpdfsdk/fpdfformfill.cpp b/fpdfsdk/fpdfformfill.cpp
index 77cba50c7c..65b0ae9852 100644
--- a/fpdfsdk/fpdfformfill.cpp
+++ b/fpdfsdk/fpdfformfill.cpp
@@ -113,7 +113,7 @@ void FFLCommon(FPDF_FORMHANDLE hHandle,
#ifdef _SKIA_SUPPORT_
pDevice->AttachRecorder(static_cast<SkPictureRecorder*>(recorder));
#endif
- CFX_RetainPtr<CFX_DIBitmap> holder(CFXBitmapFromFPDFBitmap(bitmap));
+ RetainPtr<CFX_DIBitmap> holder(CFXBitmapFromFPDFBitmap(bitmap));
pDevice->Attach(holder, false, nullptr, false);
{
CFX_RenderDevice::StateRestorer restorer(pDevice.get());
diff --git a/fpdfsdk/fpdfsave.cpp b/fpdfsdk/fpdfsave.cpp
index 455b5ba9ba..9f1e684d72 100644
--- a/fpdfsdk/fpdfsave.cpp
+++ b/fpdfsdk/fpdfsave.cpp
@@ -43,9 +43,8 @@
namespace {
#ifdef PDF_ENABLE_XFA
-bool SaveXFADocumentData(
- CPDFXFA_Context* pContext,
- std::vector<CFX_RetainPtr<IFX_SeekableStream>>* fileList) {
+bool SaveXFADocumentData(CPDFXFA_Context* pContext,
+ std::vector<RetainPtr<IFX_SeekableStream>>* fileList) {
if (!pContext)
return false;
@@ -102,7 +101,7 @@ bool SaveXFADocumentData(
CPDF_Stream* pTemplateStream = pArray->GetStreamAt(iTemplate);
auto pAcc = pdfium::MakeRetain<CPDF_StreamAcc>(pTemplateStream);
pAcc->LoadAllData();
- CFX_RetainPtr<IFX_SeekableStream> pTemplate =
+ RetainPtr<IFX_SeekableStream> pTemplate =
pdfium::MakeRetain<CFX_MemoryStream>(
const_cast<uint8_t*>(pAcc->GetData()), pAcc->GetSize(), false);
pChecksum->UpdateChecksum(pTemplate);
@@ -137,7 +136,7 @@ bool SaveXFADocumentData(
}
// L"datasets"
{
- CFX_RetainPtr<IFX_SeekableStream> pDsfileWrite =
+ RetainPtr<IFX_SeekableStream> pDsfileWrite =
pdfium::MakeRetain<CFX_MemoryStream>(false);
if (pXFADocView->GetDoc()->SavePackage(XFA_HASHCODE_Datasets, pDsfileWrite,
nullptr) &&
@@ -165,7 +164,7 @@ bool SaveXFADocumentData(
}
// L"form"
{
- CFX_RetainPtr<IFX_SeekableStream> pfileWrite =
+ RetainPtr<IFX_SeekableStream> pfileWrite =
pdfium::MakeRetain<CFX_MemoryStream>(false);
if (pXFADocView->GetDoc()->SavePackage(XFA_HASHCODE_Form, pfileWrite,
pChecksum.get()) &&
@@ -214,9 +213,8 @@ bool SendPostSaveToXFADoc(CPDFXFA_Context* pContext) {
return true;
}
-bool SendPreSaveToXFADoc(
- CPDFXFA_Context* pContext,
- std::vector<CFX_RetainPtr<IFX_SeekableStream>>* fileList) {
+bool SendPreSaveToXFADoc(CPDFXFA_Context* pContext,
+ std::vector<RetainPtr<IFX_SeekableStream>>* fileList) {
if (pContext->GetDocType() != XFA_DocType::Dynamic &&
pContext->GetDocType() != XFA_DocType::Static)
return true;
@@ -249,7 +247,7 @@ bool FPDF_Doc_Save(FPDF_DOCUMENT document,
#ifdef PDF_ENABLE_XFA
CPDFXFA_Context* pContext = static_cast<CPDFXFA_Context*>(document);
- std::vector<CFX_RetainPtr<IFX_SeekableStream>> fileList;
+ std::vector<RetainPtr<IFX_SeekableStream>> fileList;
SendPreSaveToXFADoc(pContext, &fileList);
#endif // PDF_ENABLE_XFA
diff --git a/fpdfsdk/fpdfview.cpp b/fpdfsdk/fpdfview.cpp
index c52c598783..df46ec5218 100644
--- a/fpdfsdk/fpdfview.cpp
+++ b/fpdfsdk/fpdfview.cpp
@@ -132,7 +132,7 @@ void RenderPageImpl(CPDF_PageRenderContext* pContext,
class CPDF_CustomAccess final : public IFX_SeekableReadStream {
public:
template <typename T, typename... Args>
- friend CFX_RetainPtr<T> pdfium::MakeRetain(Args&&... args);
+ friend RetainPtr<T> pdfium::MakeRetain(Args&&... args);
// IFX_SeekableReadStream
FX_FILESIZE GetSize() override;
@@ -171,7 +171,7 @@ bool CPDF_CustomAccess::ReadBlock(void* buffer,
class CFPDF_FileStream : public IFX_SeekableStream {
public:
template <typename T, typename... Args>
- friend CFX_RetainPtr<T> pdfium::MakeRetain(Args&&... args);
+ friend RetainPtr<T> pdfium::MakeRetain(Args&&... args);
~CFPDF_FileStream() override;
@@ -273,7 +273,7 @@ bool CFPDF_FileStream::Flush() {
#endif // PDF_ENABLE_XFA
FPDF_DOCUMENT LoadDocumentImpl(
- const CFX_RetainPtr<IFX_SeekableReadStream>& pFileAccess,
+ const RetainPtr<IFX_SeekableReadStream>& pFileAccess,
FPDF_BYTESTRING password) {
if (!pFileAccess) {
ProcessParseError(CPDF_Parser::FILE_ERROR);
@@ -409,13 +409,13 @@ unsigned long DecodeStreamMaybeCopyAndReturnLength(const CPDF_Stream* stream,
return len;
}
-CFX_RetainPtr<IFX_SeekableReadStream> MakeSeekableReadStream(
+RetainPtr<IFX_SeekableReadStream> MakeSeekableReadStream(
FPDF_FILEACCESS* pFileAccess) {
return pdfium::MakeRetain<CPDF_CustomAccess>(pFileAccess);
}
#ifdef PDF_ENABLE_XFA
-CFX_RetainPtr<IFX_SeekableStream> MakeSeekableStream(
+RetainPtr<IFX_SeekableStream> MakeSeekableStream(
FPDF_FILEHANDLER* pFilehandler) {
return pdfium::MakeRetain<CFPDF_FileStream>(pFilehandler);
}
@@ -598,8 +598,8 @@ FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDF_LoadXFA(FPDF_DOCUMENT document) {
class CMemFile final : public IFX_SeekableReadStream {
public:
- static CFX_RetainPtr<CMemFile> Create(uint8_t* pBuf, FX_FILESIZE size) {
- return CFX_RetainPtr<CMemFile>(new CMemFile(pBuf, size));
+ static RetainPtr<CMemFile> Create(uint8_t* pBuf, FX_FILESIZE size) {
+ return RetainPtr<CMemFile>(new CMemFile(pBuf, size));
}
FX_FILESIZE GetSize() override { return m_size; }
@@ -799,15 +799,15 @@ FX_RECT GetMaskDimensionsAndOffsets(CPDF_Page* pPage,
// Get a bitmap of just the mask section defined by |mask_box| from a full page
// bitmap |pBitmap|.
-CFX_RetainPtr<CFX_DIBitmap> GetMaskBitmap(CPDF_Page* pPage,
- int start_x,
- int start_y,
- int size_x,
- int size_y,
- int rotate,
- CFX_RetainPtr<CFX_DIBitmap>& pSrc,
- const CFX_FloatRect& mask_box,
- FX_RECT* bitmap_area) {
+RetainPtr<CFX_DIBitmap> GetMaskBitmap(CPDF_Page* pPage,
+ int start_x,
+ int start_y,
+ int size_x,
+ int size_y,
+ int rotate,
+ RetainPtr<CFX_DIBitmap>& pSrc,
+ const CFX_FloatRect& mask_box,
+ FX_RECT* bitmap_area) {
ASSERT(bitmap_area);
*bitmap_area = GetMaskDimensionsAndOffsets(pPage, start_x, start_y, size_x,
size_y, rotate, mask_box);
@@ -815,7 +815,7 @@ CFX_RetainPtr<CFX_DIBitmap> GetMaskBitmap(CPDF_Page* pPage,
return nullptr;
// Create a new bitmap to transfer part of the page bitmap to.
- CFX_RetainPtr<CFX_DIBitmap> pDst = pdfium::MakeRetain<CFX_DIBitmap>();
+ RetainPtr<CFX_DIBitmap> pDst = pdfium::MakeRetain<CFX_DIBitmap>();
pDst->Create(bitmap_area->Width(), bitmap_area->Height(), FXDIB_Argb);
pDst->Clear(0x00ffffff);
pDst->TransferBitmap(0, 0, bitmap_area->Width(), bitmap_area->Height(), pSrc,
@@ -824,7 +824,7 @@ CFX_RetainPtr<CFX_DIBitmap> GetMaskBitmap(CPDF_Page* pPage,
}
void RenderBitmap(CFX_RenderDevice* device,
- const CFX_RetainPtr<CFX_DIBitmap>& pSrc,
+ const RetainPtr<CFX_DIBitmap>& pSrc,
const FX_RECT& mask_area) {
int size_x_bm = mask_area.Width();
int size_y_bm = mask_area.Height();
@@ -832,7 +832,7 @@ void RenderBitmap(CFX_RenderDevice* device,
return;
// Create a new bitmap from the old one
- CFX_RetainPtr<CFX_DIBitmap> pDst = pdfium::MakeRetain<CFX_DIBitmap>();
+ RetainPtr<CFX_DIBitmap> pDst = pdfium::MakeRetain<CFX_DIBitmap>();
pDst->Create(size_x_bm, size_y_bm, FXDIB_Rgb32);
pDst->Clear(0xffffffff);
pDst->CompositeBitmap(0, 0, size_x_bm, size_y_bm, pSrc, 0, 0,
@@ -862,7 +862,7 @@ FPDF_EXPORT void FPDF_CALLCONV FPDF_RenderPage(HDC dc,
pPage->SetRenderContext(pdfium::MakeUnique<CPDF_PageRenderContext>());
CPDF_PageRenderContext* pContext = pPage->GetRenderContext();
- CFX_RetainPtr<CFX_DIBitmap> pBitmap;
+ RetainPtr<CFX_DIBitmap> pBitmap;
// Don't render the full page to bitmap for a mask unless there are a lot
// of masks. Full page bitmaps result in large spool sizes, so they should
// only be used when necessary. For large numbers of masks, rendering each
@@ -896,7 +896,7 @@ FPDF_EXPORT void FPDF_CALLCONV FPDF_RenderPage(HDC dc,
const std::vector<CFX_FloatRect>& mask_boxes =
pPage->GetMaskBoundingBoxes();
std::vector<FX_RECT> bitmap_areas(mask_boxes.size());
- std::vector<CFX_RetainPtr<CFX_DIBitmap>> bitmaps(mask_boxes.size());
+ std::vector<RetainPtr<CFX_DIBitmap>> bitmaps(mask_boxes.size());
for (size_t i = 0; i < mask_boxes.size(); i++) {
bitmaps[i] =
GetMaskBitmap(pPage, start_x, start_y, size_x, size_y, rotate,
@@ -966,7 +966,7 @@ FPDF_EXPORT void FPDF_CALLCONV FPDF_RenderPageBitmap(FPDF_BITMAP bitmap,
CFX_DefaultRenderDevice* pDevice = new CFX_DefaultRenderDevice;
pContext->m_pDevice.reset(pDevice);
- CFX_RetainPtr<CFX_DIBitmap> pBitmap(CFXBitmapFromFPDFBitmap(bitmap));
+ RetainPtr<CFX_DIBitmap> pBitmap(CFXBitmapFromFPDFBitmap(bitmap));
pDevice->Attach(pBitmap, !!(flags & FPDF_REVERSE_BYTE_ORDER), nullptr, false);
FPDF_RenderPage_Retail(pContext, page, start_x, start_y, size_x, size_y,
rotate, flags, true, nullptr);
@@ -997,7 +997,7 @@ FPDF_RenderPageBitmapWithMatrix(FPDF_BITMAP bitmap,
CFX_DefaultRenderDevice* pDevice = new CFX_DefaultRenderDevice;
pContext->m_pDevice.reset(pDevice);
- CFX_RetainPtr<CFX_DIBitmap> pBitmap(CFXBitmapFromFPDFBitmap(bitmap));
+ RetainPtr<CFX_DIBitmap> pBitmap(CFXBitmapFromFPDFBitmap(bitmap));
pDevice->Attach(pBitmap, !!(flags & FPDF_REVERSE_BYTE_ORDER), nullptr, false);
CFX_FloatRect clipping_rect;
@@ -1045,7 +1045,7 @@ FPDF_EXPORT void FPDF_CALLCONV FPDF_ClosePage(FPDF_PAGE page) {
return;
#ifdef PDF_ENABLE_XFA
// Take it back across the API and throw it away.
- CFX_RetainPtr<CPDFXFA_Page>().Unleak(pPage);
+ RetainPtr<CPDFXFA_Page>().Unleak(pPage);
#else // PDF_ENABLE_XFA
CPDFSDK_PageView* pPageView =
static_cast<CPDFSDK_PageView*>(pPage->GetView());
@@ -1204,7 +1204,7 @@ FPDF_EXPORT void FPDF_CALLCONV FPDFBitmap_FillRect(FPDF_BITMAP bitmap,
return;
CFX_DefaultRenderDevice device;
- CFX_RetainPtr<CFX_DIBitmap> pBitmap(CFXBitmapFromFPDFBitmap(bitmap));
+ RetainPtr<CFX_DIBitmap> pBitmap(CFXBitmapFromFPDFBitmap(bitmap));
device.Attach(pBitmap, false, nullptr, false);
if (!pBitmap->HasAlpha())
color |= 0xFF000000;
@@ -1229,7 +1229,7 @@ FPDF_EXPORT int FPDF_CALLCONV FPDFBitmap_GetStride(FPDF_BITMAP bitmap) {
}
FPDF_EXPORT void FPDF_CALLCONV FPDFBitmap_Destroy(FPDF_BITMAP bitmap) {
- CFX_RetainPtr<CFX_DIBitmap> destroyer;
+ RetainPtr<CFX_DIBitmap> destroyer;
destroyer.Unleak(CFXBitmapFromFPDFBitmap(bitmap));
}
@@ -1265,7 +1265,7 @@ FPDF_EXPORT int FPDF_CALLCONV FPDF_GetPageSizeByIndex(FPDF_DOCUMENT document,
int count = pDoc->GetPageCount();
if (page_index < 0 || page_index >= count)
return false;
- CFX_RetainPtr<CPDFXFA_Page> pPage = pDoc->GetXFAPage(page_index);
+ RetainPtr<CPDFXFA_Page> pPage = pDoc->GetXFAPage(page_index);
if (!pPage)
return false;
*width = pPage->GetPageWidth();
diff --git a/fpdfsdk/fpdfxfa/cpdfxfa_context.cpp b/fpdfsdk/fpdfxfa/cpdfxfa_context.cpp
index b7dd33fa32..a67ac0178b 100644
--- a/fpdfsdk/fpdfxfa/cpdfxfa_context.cpp
+++ b/fpdfsdk/fpdfxfa/cpdfxfa_context.cpp
@@ -153,7 +153,7 @@ int CPDFXFA_Context::GetPageCount() const {
}
}
-CFX_RetainPtr<CPDFXFA_Page> CPDFXFA_Context::GetXFAPage(int page_index) {
+RetainPtr<CPDFXFA_Page> CPDFXFA_Context::GetXFAPage(int page_index) {
if (page_index < 0)
return nullptr;
@@ -175,7 +175,7 @@ CFX_RetainPtr<CPDFXFA_Page> CPDFXFA_Context::GetXFAPage(int page_index) {
return pPage;
}
-CFX_RetainPtr<CPDFXFA_Page> CPDFXFA_Context::GetXFAPage(
+RetainPtr<CPDFXFA_Page> CPDFXFA_Context::GetXFAPage(
CXFA_FFPageView* pPage) const {
if (!pPage)
return nullptr;
@@ -314,7 +314,7 @@ WideString CPDFXFA_Context::Response(const WideString& wsQuestion,
nLength / sizeof(uint16_t));
}
-CFX_RetainPtr<IFX_SeekableReadStream> CPDFXFA_Context::DownloadURL(
+RetainPtr<IFX_SeekableReadStream> CPDFXFA_Context::DownloadURL(
const WideString& wsURL) {
return m_pFormFillEnv ? m_pFormFillEnv->DownloadFromURL(wsURL.c_str())
: nullptr;
diff --git a/fpdfsdk/fpdfxfa/cpdfxfa_context.h b/fpdfsdk/fpdfxfa/cpdfxfa_context.h
index 0dbc51e54b..df42cbb9fd 100644
--- a/fpdfsdk/fpdfxfa/cpdfxfa_context.h
+++ b/fpdfsdk/fpdfxfa/cpdfxfa_context.h
@@ -51,8 +51,8 @@ class CPDFXFA_Context : public IXFA_AppProvider {
int GetPageCount() const;
void DeletePage(int page_index);
- CFX_RetainPtr<CPDFXFA_Page> GetXFAPage(int page_index);
- CFX_RetainPtr<CPDFXFA_Page> GetXFAPage(CXFA_FFPageView* pPage) const;
+ RetainPtr<CPDFXFA_Page> GetXFAPage(int page_index);
+ RetainPtr<CPDFXFA_Page> GetXFAPage(CXFA_FFPageView* pPage) const;
void ClearChangeMark();
// IFXA_AppProvider:
@@ -70,7 +70,7 @@ class CPDFXFA_Context : public IXFA_AppProvider {
const WideString& wsTitle,
const WideString& wsDefaultAnswer,
bool bMark) override;
- CFX_RetainPtr<IFX_SeekableReadStream> DownloadURL(
+ RetainPtr<IFX_SeekableReadStream> DownloadURL(
const WideString& wsURL) override;
bool PostRequestURL(const WideString& wsURL,
const WideString& wsData,
@@ -94,7 +94,7 @@ class CPDFXFA_Context : public IXFA_AppProvider {
}
LoadStatus GetLoadStatus() const { return m_nLoadStatus; }
- std::vector<CFX_RetainPtr<CPDFXFA_Page>>* GetXFAPageList() {
+ std::vector<RetainPtr<CPDFXFA_Page>>* GetXFAPageList() {
return &m_XFAPageList;
}
@@ -108,7 +108,7 @@ class CPDFXFA_Context : public IXFA_AppProvider {
CFX_UnownedPtr<CXFA_FFDocView> m_pXFADocView;
std::unique_ptr<CXFA_FFApp> m_pXFAApp;
std::unique_ptr<CJS_Runtime> m_pRuntime;
- std::vector<CFX_RetainPtr<CPDFXFA_Page>> m_XFAPageList;
+ std::vector<RetainPtr<CPDFXFA_Page>> m_XFAPageList;
LoadStatus m_nLoadStatus;
int m_nPageCount;
diff --git a/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp b/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp
index b4dc3f1ed0..4dcdcac0f6 100644
--- a/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp
+++ b/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp
@@ -11,7 +11,7 @@
#include "core/fpdfapi/parser/cpdf_array.h"
#include "core/fpdfapi/parser/cpdf_stream_acc.h"
#include "core/fpdfapi/parser/cpdf_string.h"
-#include "core/fxcrt/cfx_retain_ptr.h"
+#include "core/fxcrt/retain_ptr.h"
#include "fpdfsdk/cpdfsdk_formfillenvironment.h"
#include "fpdfsdk/cpdfsdk_interform.h"
#include "fpdfsdk/cpdfsdk_pageview.h"
@@ -58,7 +58,7 @@ void CPDFXFA_DocEnvironment::InvalidateRect(CXFA_FFPageView* pPageView,
if (m_pContext->GetDocType() != XFA_DocType::Dynamic)
return;
- CFX_RetainPtr<CPDFXFA_Page> pPage = m_pContext->GetXFAPage(pPageView);
+ RetainPtr<CPDFXFA_Page> pPage = m_pContext->GetXFAPage(pPageView);
if (!pPage)
return;
@@ -88,7 +88,7 @@ void CPDFXFA_DocEnvironment::DisplayCaret(CXFA_FFWidget* hWidget,
if (!pPageView)
return;
- CFX_RetainPtr<CPDFXFA_Page> pPage = m_pContext->GetXFAPage(pPageView);
+ RetainPtr<CPDFXFA_Page> pPage = m_pContext->GetXFAPage(pPageView);
if (!pPage)
return;
@@ -113,7 +113,7 @@ bool CPDFXFA_DocEnvironment::GetPopupPos(CXFA_FFWidget* hWidget,
if (!pXFAPageView)
return false;
- CFX_RetainPtr<CPDFXFA_Page> pPage = m_pContext->GetXFAPage(pXFAPageView);
+ RetainPtr<CPDFXFA_Page> pPage = m_pContext->GetXFAPage(pXFAPageView);
if (!pPage)
return false;
@@ -225,7 +225,7 @@ bool CPDFXFA_DocEnvironment::PopupMenu(CXFA_FFWidget* hWidget,
if (!pXFAPageView)
return false;
- CFX_RetainPtr<CPDFXFA_Page> pPage = m_pContext->GetXFAPage(pXFAPageView);
+ RetainPtr<CPDFXFA_Page> pPage = m_pContext->GetXFAPage(pXFAPageView);
if (!pPage)
return false;
@@ -271,8 +271,7 @@ void CPDFXFA_DocEnvironment::PageViewEvent(CXFA_FFPageView* pPageView,
for (int iPageIter = 0; iPageIter < m_pContext->GetOriginalPageCount();
iPageIter++) {
- CFX_RetainPtr<CPDFXFA_Page> pPage =
- (*m_pContext->GetXFAPageList())[iPageIter];
+ RetainPtr<CPDFXFA_Page> pPage = (*m_pContext->GetXFAPageList())[iPageIter];
if (!pPage)
continue;
@@ -297,7 +296,7 @@ void CPDFXFA_DocEnvironment::WidgetPostAdd(CXFA_FFWidget* hWidget,
if (!pPageView)
return;
- CFX_RetainPtr<CPDFXFA_Page> pXFAPage = m_pContext->GetXFAPage(pPageView);
+ RetainPtr<CPDFXFA_Page> pXFAPage = m_pContext->GetXFAPage(pPageView);
if (!pXFAPage)
return;
@@ -315,7 +314,7 @@ void CPDFXFA_DocEnvironment::WidgetPreRemove(CXFA_FFWidget* hWidget,
if (!pPageView)
return;
- CFX_RetainPtr<CPDFXFA_Page> pXFAPage = m_pContext->GetXFAPage(pPageView);
+ RetainPtr<CPDFXFA_Page> pXFAPage = m_pContext->GetXFAPage(pPageView);
if (!pXFAPage)
return;
@@ -436,8 +435,7 @@ void CPDFXFA_DocEnvironment::ExportData(CXFA_FFDoc* hDoc,
if (!pFileHandler)
return;
- CFX_RetainPtr<IFX_SeekableStream> fileWrite =
- MakeSeekableStream(pFileHandler);
+ RetainPtr<IFX_SeekableStream> fileWrite = MakeSeekableStream(pFileHandler);
ByteString content;
if (fileType == FXFA_SAVEAS_XML) {
content = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n";
@@ -697,7 +695,7 @@ bool CPDFXFA_DocEnvironment::SubmitData(CXFA_FFDoc* hDoc, CXFA_Submit submit) {
return ret;
}
-CFX_RetainPtr<IFX_SeekableReadStream> CPDFXFA_DocEnvironment::OpenLinkedFile(
+RetainPtr<IFX_SeekableReadStream> CPDFXFA_DocEnvironment::OpenLinkedFile(
CXFA_FFDoc* hDoc,
const WideString& wsLink) {
CPDFSDK_FormFillEnvironment* pFormFillEnv = m_pContext->GetFormFillEnv();
@@ -727,8 +725,7 @@ bool CPDFXFA_DocEnvironment::ExportSubmitFile(FPDF_FILEHANDLER* pFileHandler,
if (!pFormFillEnv)
return false;
- CFX_RetainPtr<IFX_SeekableStream> fileStream =
- MakeSeekableStream(pFileHandler);
+ RetainPtr<IFX_SeekableStream> fileStream = MakeSeekableStream(pFileHandler);
if (fileType == FXFA_SAVEAS_XML) {
const char kContent[] = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n";
diff --git a/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.h b/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.h
index e6a0f926af..6f7d41d86e 100644
--- a/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.h
+++ b/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.h
@@ -7,8 +7,8 @@
#ifndef FPDFSDK_FPDFXFA_CPDFXFA_DOCENVIRONMENT_H_
#define FPDFSDK_FPDFXFA_CPDFXFA_DOCENVIRONMENT_H_
-#include "core/fxcrt/cfx_retain_ptr.h"
#include "core/fxcrt/cfx_unowned_ptr.h"
+#include "core/fxcrt/retain_ptr.h"
#include "public/fpdfview.h"
#include "xfa/fxfa/fxfa.h"
@@ -85,7 +85,7 @@ class CPDFXFA_DocEnvironment : public IXFA_DocEnvironment {
const ByteStringView& szPropName,
CFXJSE_Value* pValue) override;
- CFX_RetainPtr<IFX_SeekableReadStream> OpenLinkedFile(
+ RetainPtr<IFX_SeekableReadStream> OpenLinkedFile(
CXFA_FFDoc* hDoc,
const WideString& wsLink) override;
diff --git a/fpdfsdk/fpdfxfa/cpdfxfa_page.h b/fpdfsdk/fpdfxfa/cpdfxfa_page.h
index 19dc0f29b1..5c4e0dca76 100644
--- a/fpdfsdk/fpdfxfa/cpdfxfa_page.h
+++ b/fpdfsdk/fpdfxfa/cpdfxfa_page.h
@@ -9,9 +9,9 @@
#include <memory>
-#include "core/fxcrt/cfx_retain_ptr.h"
#include "core/fxcrt/cfx_unowned_ptr.h"
#include "core/fxcrt/fx_system.h"
+#include "core/fxcrt/retain_ptr.h"
class CFX_Matrix;
class CPDFXFA_Context;
@@ -19,10 +19,10 @@ class CPDF_Dictionary;
class CPDF_Page;
class CXFA_FFPageView;
-class CPDFXFA_Page : public CFX_Retainable {
+class CPDFXFA_Page : public Retainable {
public:
template <typename T, typename... Args>
- friend CFX_RetainPtr<T> pdfium::MakeRetain(Args&&... args);
+ friend RetainPtr<T> pdfium::MakeRetain(Args&&... args);
bool LoadPage();
bool LoadPDFPage(CPDF_Dictionary* pageDict);
diff --git a/fpdfsdk/fsdk_define.h b/fpdfsdk/fsdk_define.h
index 68ba585c0a..f52e57abcc 100644
--- a/fpdfsdk/fsdk_define.h
+++ b/fpdfsdk/fsdk_define.h
@@ -32,13 +32,13 @@ class FX_PATHPOINT;
// Layering prevents fxcrt from knowing about FPDF_FILEACCESS, so this can't
// be a static method of IFX_SeekableReadStream.
-CFX_RetainPtr<IFX_SeekableReadStream> MakeSeekableReadStream(
+RetainPtr<IFX_SeekableReadStream> MakeSeekableReadStream(
FPDF_FILEACCESS* pFileAccess);
#ifdef PDF_ENABLE_XFA
// Layering prevents fxcrt from knowing about FPDF_FILEHANDLER, so this can't
// be a static method of IFX_SeekableStream.
-CFX_RetainPtr<IFX_SeekableStream> MakeSeekableStream(
+RetainPtr<IFX_SeekableStream> MakeSeekableStream(
FPDF_FILEHANDLER* pFileHandler);
#endif // PDF_ENABLE_XFA
diff --git a/fpdfsdk/fsdk_filewriteadapter.h b/fpdfsdk/fsdk_filewriteadapter.h
index 5e9eaabea6..6bba1da9a7 100644
--- a/fpdfsdk/fsdk_filewriteadapter.h
+++ b/fpdfsdk/fsdk_filewriteadapter.h
@@ -7,14 +7,14 @@
#ifndef FPDFSDK_FSDK_FILEWRITEADAPTER_H_
#define FPDFSDK_FSDK_FILEWRITEADAPTER_H_
-#include "core/fxcrt/cfx_retain_ptr.h"
#include "core/fxcrt/fx_stream.h"
+#include "core/fxcrt/retain_ptr.h"
#include "public/fpdf_save.h"
class FSDK_FileWriteAdapter : public IFX_WriteStream {
public:
template <typename T, typename... Args>
- friend CFX_RetainPtr<T> pdfium::MakeRetain(Args&&... args);
+ friend RetainPtr<T> pdfium::MakeRetain(Args&&... args);
bool WriteBlock(const void* data, size_t size) override;
bool WriteString(const ByteStringView& str) override;