From 0b95042db2e6dab5876abd12ce485fff0a8e08fe Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Thu, 21 Sep 2017 15:49:49 -0400 Subject: Rename CFX_RetainPtr to RetainPtr This CL renames CFX_RetainPtr to RetainPtr and places in the fxcrt namespace. Bug: pdfium:898 Change-Id: I8798a9f79cb0840d3f037e8d04937cedd742914e Reviewed-on: https://pdfium-review.googlesource.com/14616 Reviewed-by: Tom Sepez Commit-Queue: dsinclair --- fpdfsdk/fpdfxfa/cpdfxfa_context.cpp | 6 +++--- fpdfsdk/fpdfxfa/cpdfxfa_context.h | 10 +++++----- fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp | 25 +++++++++++-------------- fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.h | 4 ++-- fpdfsdk/fpdfxfa/cpdfxfa_page.h | 6 +++--- 5 files changed, 24 insertions(+), 27 deletions(-) (limited to 'fpdfsdk/fpdfxfa') 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_Context::GetXFAPage(int page_index) { +RetainPtr CPDFXFA_Context::GetXFAPage(int page_index) { if (page_index < 0) return nullptr; @@ -175,7 +175,7 @@ CFX_RetainPtr CPDFXFA_Context::GetXFAPage(int page_index) { return pPage; } -CFX_RetainPtr CPDFXFA_Context::GetXFAPage( +RetainPtr 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 CPDFXFA_Context::DownloadURL( +RetainPtr 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 GetXFAPage(int page_index); - CFX_RetainPtr GetXFAPage(CXFA_FFPageView* pPage) const; + RetainPtr GetXFAPage(int page_index); + RetainPtr 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 DownloadURL( + RetainPtr 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>* GetXFAPageList() { + std::vector>* GetXFAPageList() { return &m_XFAPageList; } @@ -108,7 +108,7 @@ class CPDFXFA_Context : public IXFA_AppProvider { CFX_UnownedPtr m_pXFADocView; std::unique_ptr m_pXFAApp; std::unique_ptr m_pRuntime; - std::vector> m_XFAPageList; + std::vector> 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 pPage = m_pContext->GetXFAPage(pPageView); + RetainPtr pPage = m_pContext->GetXFAPage(pPageView); if (!pPage) return; @@ -88,7 +88,7 @@ void CPDFXFA_DocEnvironment::DisplayCaret(CXFA_FFWidget* hWidget, if (!pPageView) return; - CFX_RetainPtr pPage = m_pContext->GetXFAPage(pPageView); + RetainPtr 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 pPage = m_pContext->GetXFAPage(pXFAPageView); + RetainPtr 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 pPage = m_pContext->GetXFAPage(pXFAPageView); + RetainPtr 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 pPage = - (*m_pContext->GetXFAPageList())[iPageIter]; + RetainPtr pPage = (*m_pContext->GetXFAPageList())[iPageIter]; if (!pPage) continue; @@ -297,7 +296,7 @@ void CPDFXFA_DocEnvironment::WidgetPostAdd(CXFA_FFWidget* hWidget, if (!pPageView) return; - CFX_RetainPtr pXFAPage = m_pContext->GetXFAPage(pPageView); + RetainPtr pXFAPage = m_pContext->GetXFAPage(pPageView); if (!pXFAPage) return; @@ -315,7 +314,7 @@ void CPDFXFA_DocEnvironment::WidgetPreRemove(CXFA_FFWidget* hWidget, if (!pPageView) return; - CFX_RetainPtr pXFAPage = m_pContext->GetXFAPage(pPageView); + RetainPtr pXFAPage = m_pContext->GetXFAPage(pPageView); if (!pXFAPage) return; @@ -436,8 +435,7 @@ void CPDFXFA_DocEnvironment::ExportData(CXFA_FFDoc* hDoc, if (!pFileHandler) return; - CFX_RetainPtr fileWrite = - MakeSeekableStream(pFileHandler); + RetainPtr fileWrite = MakeSeekableStream(pFileHandler); ByteString content; if (fileType == FXFA_SAVEAS_XML) { content = "\r\n"; @@ -697,7 +695,7 @@ bool CPDFXFA_DocEnvironment::SubmitData(CXFA_FFDoc* hDoc, CXFA_Submit submit) { return ret; } -CFX_RetainPtr CPDFXFA_DocEnvironment::OpenLinkedFile( +RetainPtr 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 fileStream = - MakeSeekableStream(pFileHandler); + RetainPtr fileStream = MakeSeekableStream(pFileHandler); if (fileType == FXFA_SAVEAS_XML) { const char kContent[] = "\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 OpenLinkedFile( + RetainPtr 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 -#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 - friend CFX_RetainPtr pdfium::MakeRetain(Args&&... args); + friend RetainPtr pdfium::MakeRetain(Args&&... args); bool LoadPage(); bool LoadPDFPage(CPDF_Dictionary* pageDict); -- cgit v1.2.3