diff options
Diffstat (limited to 'fpdfsdk/pdfwindow')
-rw-r--r-- | fpdfsdk/pdfwindow/PWL_FontMap.cpp | 4 | ||||
-rw-r--r-- | fpdfsdk/pdfwindow/PWL_ListBox.cpp | 3 | ||||
-rw-r--r-- | fpdfsdk/pdfwindow/PWL_Wnd.cpp | 6 |
3 files changed, 8 insertions, 5 deletions
diff --git a/fpdfsdk/pdfwindow/PWL_FontMap.cpp b/fpdfsdk/pdfwindow/PWL_FontMap.cpp index 57feb27dcd..440efe5a06 100644 --- a/fpdfsdk/pdfwindow/PWL_FontMap.cpp +++ b/fpdfsdk/pdfwindow/PWL_FontMap.cpp @@ -13,6 +13,7 @@ #include "core/fpdfapi/fpdf_parser/cpdf_parser.h" #include "core/fpdfdoc/ipvt_fontmap.h" #include "fpdfsdk/pdfwindow/PWL_Wnd.h" +#include "third_party/base/ptr_util.h" namespace { @@ -47,7 +48,8 @@ CPWL_FontMap::~CPWL_FontMap() { CPDF_Document* CPWL_FontMap::GetDocument() { if (!m_pPDFDoc) { if (CPDF_ModuleMgr::Get()) { - m_pPDFDoc = WrapUnique(new CPDF_Document(std::unique_ptr<CPDF_Parser>())); + m_pPDFDoc = + pdfium::MakeUnique<CPDF_Document>(std::unique_ptr<CPDF_Parser>()); m_pPDFDoc->CreateNewDoc(); } } diff --git a/fpdfsdk/pdfwindow/PWL_ListBox.cpp b/fpdfsdk/pdfwindow/PWL_ListBox.cpp index 1af2682570..8739c3b515 100644 --- a/fpdfsdk/pdfwindow/PWL_ListBox.cpp +++ b/fpdfsdk/pdfwindow/PWL_ListBox.cpp @@ -14,6 +14,7 @@ #include "fpdfsdk/pdfwindow/PWL_Utils.h" #include "fpdfsdk/pdfwindow/PWL_Wnd.h" #include "public/fpdf_fwlevent.h" +#include "third_party/base/ptr_util.h" CPWL_List_Notify::CPWL_List_Notify(CPWL_ListBox* pList) : m_pList(pList) { ASSERT(m_pList); @@ -76,7 +77,7 @@ CFX_ByteString CPWL_ListBox::GetClassName() const { void CPWL_ListBox::OnCreated() { m_pList->SetFontMap(GetFontMap()); - m_pListNotify = WrapUnique(new CPWL_List_Notify(this)); + m_pListNotify = pdfium::MakeUnique<CPWL_List_Notify>(this); m_pList->SetNotify(m_pListNotify.get()); SetHoverSel(HasFlag(PLBS_HOVERSEL)); diff --git a/fpdfsdk/pdfwindow/PWL_Wnd.cpp b/fpdfsdk/pdfwindow/PWL_Wnd.cpp index 207157db7e..729b27ca5d 100644 --- a/fpdfsdk/pdfwindow/PWL_Wnd.cpp +++ b/fpdfsdk/pdfwindow/PWL_Wnd.cpp @@ -9,6 +9,7 @@ #include "fpdfsdk/pdfwindow/PWL_ScrollBar.h" #include "fpdfsdk/pdfwindow/PWL_Utils.h" #include "fpdfsdk/pdfwindow/PWL_Wnd.h" +#include "third_party/base/ptr_util.h" static std::map<int32_t, CPWL_Timer*>& GetPWLTimeMap() { // Leak the object at shutdown. @@ -86,10 +87,9 @@ CPWL_TimerHandler::~CPWL_TimerHandler() {} void CPWL_TimerHandler::BeginTimer(int32_t nElapse) { if (!m_pTimer) - m_pTimer = WrapUnique(new CPWL_Timer(this, GetSystemHandler())); + m_pTimer = pdfium::MakeUnique<CPWL_Timer>(this, GetSystemHandler()); - if (m_pTimer) - m_pTimer->SetPWLTimer(nElapse); + m_pTimer->SetPWLTimer(nElapse); } void CPWL_TimerHandler::EndTimer() { |