Convert pdfium::MakeUnique<> to std::make_unique<> in fpdfsdk
Use C++14 features.
-- ensure <memory> included in .cpp or corresponding .h file
-- remove ptr_util.h include unless WrapUnique() (3 cases).
Change-Id: I319cdb33ccadf94421edbeff5ea43e0e7cffa1c4
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/69955
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
diff --git a/fpdfsdk/cpdfsdk_appstream.cpp b/fpdfsdk/cpdfsdk_appstream.cpp
index e451977..68e3e8f 100644
--- a/fpdfsdk/cpdfsdk_appstream.cpp
+++ b/fpdfsdk/cpdfsdk_appstream.cpp
@@ -6,6 +6,7 @@
#include "fpdfsdk/cpdfsdk_appstream.h"
+#include <memory>
#include <utility>
#include "constants/form_flags.h"
@@ -30,7 +31,6 @@
#include "fpdfsdk/pwl/cpwl_edit_impl.h"
#include "fpdfsdk/pwl/cpwl_icon.h"
#include "fpdfsdk/pwl/cpwl_wnd.h"
-#include "third_party/base/ptr_util.h"
namespace {
@@ -690,7 +690,7 @@
CPWL_Wnd::CreateParams cp;
cp.dwFlags = PWS_VISIBLE;
- CPWL_Icon icon(cp, pdfium::MakeUnique<CPDF_Icon>(pIconStream), &fit);
+ CPWL_Icon icon(cp, std::make_unique<CPDF_Icon>(pIconStream), &fit);
icon.Realize();
if (!icon.Move(rcIcon, false, false))
return ByteString();
@@ -742,7 +742,7 @@
ButtonStyle nLayOut) {
const float fAutoFontScale = 1.0f / 3.0f;
- auto pEdit = pdfium::MakeUnique<CPWL_EditImpl>();
+ auto pEdit = std::make_unique<CPWL_EditImpl>();
pEdit->SetFontMap(pFontMap);
pEdit->SetAlignmentH(1, true);
pEdit->SetAlignmentV(1, true);
@@ -1572,7 +1572,7 @@
CBA_FontMap font_map(widget_->GetPDFPage()->GetDocument(),
widget_->GetPDFAnnot()->GetAnnotDict());
- auto pEdit = pdfium::MakeUnique<CPWL_EditImpl>();
+ auto pEdit = std::make_unique<CPWL_EditImpl>();
pEdit->EnableRefresh(false);
pEdit->SetFontMap(&font_map);
@@ -1638,7 +1638,7 @@
CBA_FontMap font_map(widget_->GetPDFPage()->GetDocument(),
widget_->GetPDFAnnot()->GetAnnotDict());
- auto pEdit = pdfium::MakeUnique<CPWL_EditImpl>();
+ auto pEdit = std::make_unique<CPWL_EditImpl>();
pEdit->EnableRefresh(false);
pEdit->SetFontMap(&font_map);
pEdit->SetPlateRect(CFX_FloatRect(rcClient.left, 0.0f, rcClient.right, 0.0f));
@@ -1722,7 +1722,7 @@
CBA_FontMap font_map(widget_->GetPDFPage()->GetDocument(),
widget_->GetPDFAnnot()->GetAnnotDict());
- auto pEdit = pdfium::MakeUnique<CPWL_EditImpl>();
+ auto pEdit = std::make_unique<CPWL_EditImpl>();
pEdit->EnableRefresh(false);
pEdit->SetFontMap(&font_map);
diff --git a/fpdfsdk/cpdfsdk_baannothandler.cpp b/fpdfsdk/cpdfsdk_baannothandler.cpp
index 2f092e3..49daae8 100644
--- a/fpdfsdk/cpdfsdk_baannothandler.cpp
+++ b/fpdfsdk/cpdfsdk_baannothandler.cpp
@@ -20,7 +20,6 @@
#include "fpdfsdk/cpdfsdk_pageview.h"
#include "fpdfsdk/formfiller/cffl_formfiller.h"
#include "public/fpdf_fwlevent.h"
-#include "third_party/base/ptr_util.h"
#include "third_party/base/stl_util.h"
namespace {
@@ -56,7 +55,7 @@
std::unique_ptr<CPDFSDK_Annot> CPDFSDK_BAAnnotHandler::NewAnnot(
CPDF_Annot* pAnnot,
CPDFSDK_PageView* pPageView) {
- return pdfium::MakeUnique<CPDFSDK_BAAnnot>(pAnnot, pPageView);
+ return std::make_unique<CPDFSDK_BAAnnot>(pAnnot, pPageView);
}
void CPDFSDK_BAAnnotHandler::ReleaseAnnot(
diff --git a/fpdfsdk/cpdfsdk_formfillenvironment.cpp b/fpdfsdk/cpdfsdk_formfillenvironment.cpp
index 0591408..d74ac22 100644
--- a/fpdfsdk/cpdfsdk_formfillenvironment.cpp
+++ b/fpdfsdk/cpdfsdk_formfillenvironment.cpp
@@ -24,7 +24,6 @@
#include "fpdfsdk/formfiller/cffl_formfiller.h"
#include "fpdfsdk/formfiller/cffl_interactiveformfiller.h"
#include "fxjs/ijs_runtime.h"
-#include "third_party/base/ptr_util.h"
#include "third_party/base/stl_util.h"
FPDF_WIDESTRING AsFPDFWideString(ByteString* bsUTF16LE) {
@@ -325,14 +324,14 @@
CPDFSDK_ActionHandler* CPDFSDK_FormFillEnvironment::GetActionHandler() {
if (!m_pActionHandler)
- m_pActionHandler = pdfium::MakeUnique<CPDFSDK_ActionHandler>();
+ m_pActionHandler = std::make_unique<CPDFSDK_ActionHandler>();
return m_pActionHandler.get();
}
CFFL_InteractiveFormFiller*
CPDFSDK_FormFillEnvironment::GetInteractiveFormFiller() {
if (!m_pFormFiller)
- m_pFormFiller = pdfium::MakeUnique<CFFL_InteractiveFormFiller>(this);
+ m_pFormFiller = std::make_unique<CFFL_InteractiveFormFiller>(this);
return m_pFormFiller.get();
}
@@ -577,7 +576,7 @@
if (!renew)
return nullptr;
- auto pNew = pdfium::MakeUnique<CPDFSDK_PageView>(this, pUnderlyingPage);
+ auto pNew = std::make_unique<CPDFSDK_PageView>(this, pUnderlyingPage);
CPDFSDK_PageView* pPageView = pNew.get();
m_PageMap[pUnderlyingPage] = std::move(pNew);
@@ -666,7 +665,7 @@
CPDFSDK_InteractiveForm* CPDFSDK_FormFillEnvironment::GetInteractiveForm() {
if (!m_pInteractiveForm)
- m_pInteractiveForm = pdfium::MakeUnique<CPDFSDK_InteractiveForm>(this);
+ m_pInteractiveForm = std::make_unique<CPDFSDK_InteractiveForm>(this);
return m_pInteractiveForm.get();
}
@@ -777,7 +776,7 @@
CPDF_Dictionary* annot_dict = (*pAnnot)->GetPDFAnnot()->GetAnnotDict();
- auto focused_annot = pdfium::MakeUnique<CPDF_AnnotContext>(annot_dict, page);
+ auto focused_annot = std::make_unique<CPDF_AnnotContext>(annot_dict, page);
FPDF_ANNOTATION fpdf_annot =
FPDFAnnotationFromCPDFAnnotContext(focused_annot.get());
diff --git a/fpdfsdk/cpdfsdk_interactiveform.cpp b/fpdfsdk/cpdfsdk_interactiveform.cpp
index c724af5..4bc4951 100644
--- a/fpdfsdk/cpdfsdk_interactiveform.cpp
+++ b/fpdfsdk/cpdfsdk_interactiveform.cpp
@@ -36,7 +36,6 @@
#include "fpdfsdk/ipdfsdk_annothandler.h"
#include "fxjs/ijs_event_context.h"
#include "fxjs/ijs_runtime.h"
-#include "third_party/base/ptr_util.h"
namespace {
@@ -114,7 +113,7 @@
CPDFSDK_InteractiveForm::CPDFSDK_InteractiveForm(
CPDFSDK_FormFillEnvironment* pFormFillEnv)
: m_pFormFillEnv(pFormFillEnv),
- m_pInteractiveForm(pdfium::MakeUnique<CPDF_InteractiveForm>(
+ m_pInteractiveForm(std::make_unique<CPDF_InteractiveForm>(
m_pFormFillEnv->GetPDFDocument())) {
m_pInteractiveForm->SetNotifierIface(this);
RemoveAllHighLights();
diff --git a/fpdfsdk/cpdfsdk_pageview.cpp b/fpdfsdk/cpdfsdk_pageview.cpp
index 3fa9d81..2337f30 100644
--- a/fpdfsdk/cpdfsdk_pageview.cpp
+++ b/fpdfsdk/cpdfsdk_pageview.cpp
@@ -510,7 +510,7 @@
bool bUpdateAP = CPDF_InteractiveForm::IsUpdateAPEnabled();
// Disable the default AP construction.
CPDF_InteractiveForm::SetUpdateAP(false);
- m_pAnnotList = pdfium::MakeUnique<CPDF_AnnotList>(pPage);
+ m_pAnnotList = std::make_unique<CPDF_AnnotList>(pPage);
CPDF_InteractiveForm::SetUpdateAP(bUpdateAP);
const size_t nCount = m_pAnnotList->Count();
diff --git a/fpdfsdk/cpdfsdk_renderpage.cpp b/fpdfsdk/cpdfsdk_renderpage.cpp
index ae2fdfa..ab3ce61 100644
--- a/fpdfsdk/cpdfsdk_renderpage.cpp
+++ b/fpdfsdk/cpdfsdk_renderpage.cpp
@@ -6,6 +6,7 @@
#include "fpdfsdk/cpdfsdk_renderpage.h"
+#include <memory>
#include <utility>
#include "core/fpdfapi/render/cpdf_pagerendercache.h"
@@ -16,7 +17,6 @@
#include "core/fxge/cfx_renderdevice.h"
#include "fpdfsdk/cpdfsdk_helpers.h"
#include "fpdfsdk/cpdfsdk_pauseadapter.h"
-#include "third_party/base/ptr_util.h"
namespace {
@@ -29,7 +29,7 @@
bool need_to_restore,
CPDFSDK_PauseAdapter* pause) {
if (!pContext->m_pOptions)
- pContext->m_pOptions = pdfium::MakeUnique<CPDF_RenderOptions>();
+ pContext->m_pOptions = std::make_unique<CPDF_RenderOptions>();
auto& options = pContext->m_pOptions->GetOptions();
options.bClearType = !!(flags & FPDF_LCD_TEXT);
@@ -58,14 +58,14 @@
pContext->m_pDevice->SaveState();
pContext->m_pDevice->SetBaseClip(clipping_rect);
pContext->m_pDevice->SetClip_Rect(clipping_rect);
- pContext->m_pContext = pdfium::MakeUnique<CPDF_RenderContext>(
+ pContext->m_pContext = std::make_unique<CPDF_RenderContext>(
pPage->GetDocument(), pPage->m_pPageResources.Get(),
static_cast<CPDF_PageRenderCache*>(pPage->GetRenderCache()));
pContext->m_pContext->AppendLayer(pPage, &matrix);
if (flags & FPDF_ANNOT) {
- auto pOwnedList = pdfium::MakeUnique<CPDF_AnnotList>(pPage);
+ auto pOwnedList = std::make_unique<CPDF_AnnotList>(pPage);
CPDF_AnnotList* pList = pOwnedList.get();
pContext->m_pAnnots = std::move(pOwnedList);
bool bPrinting =
@@ -74,7 +74,7 @@
false, nullptr);
}
- pContext->m_pRenderer = pdfium::MakeUnique<CPDF_ProgressiveRenderer>(
+ pContext->m_pRenderer = std::make_unique<CPDF_ProgressiveRenderer>(
pContext->m_pContext.get(), pContext->m_pDevice.get(),
pContext->m_pOptions.get());
pContext->m_pRenderer->Start(pause);
diff --git a/fpdfsdk/cpdfsdk_widgethandler.cpp b/fpdfsdk/cpdfsdk_widgethandler.cpp
index 1e92872..8e1b0bd 100644
--- a/fpdfsdk/cpdfsdk_widgethandler.cpp
+++ b/fpdfsdk/cpdfsdk_widgethandler.cpp
@@ -20,7 +20,6 @@
#include "fpdfsdk/cpdfsdk_pageview.h"
#include "fpdfsdk/cpdfsdk_widget.h"
#include "fpdfsdk/formfiller/cffl_formfiller.h"
-#include "third_party/base/ptr_util.h"
#include "third_party/base/stl_util.h"
CPDFSDK_WidgetHandler::CPDFSDK_WidgetHandler() = default;
@@ -63,7 +62,7 @@
if (!pCtrl)
return nullptr;
- auto pWidget = pdfium::MakeUnique<CPDFSDK_Widget>(pAnnot, pPageView, pForm);
+ auto pWidget = std::make_unique<CPDFSDK_Widget>(pAnnot, pPageView, pForm);
pForm->AddMap(pCtrl, pWidget.get());
if (pPDFForm->NeedConstructAP())
pWidget->ResetAppearance(pdfium::nullopt, false);
diff --git a/fpdfsdk/formfiller/cffl_checkbox.cpp b/fpdfsdk/formfiller/cffl_checkbox.cpp
index b0e60e2..47e158f 100644
--- a/fpdfsdk/formfiller/cffl_checkbox.cpp
+++ b/fpdfsdk/formfiller/cffl_checkbox.cpp
@@ -14,7 +14,6 @@
#include "fpdfsdk/formfiller/cffl_formfiller.h"
#include "fpdfsdk/pwl/cpwl_special_button.h"
#include "public/fpdf_fwlevent.h"
-#include "third_party/base/ptr_util.h"
CFFL_CheckBox::CFFL_CheckBox(CPDFSDK_FormFillEnvironment* pApp,
CPDFSDK_Widget* pWidget)
@@ -25,7 +24,7 @@
std::unique_ptr<CPWL_Wnd> CFFL_CheckBox::NewPWLWindow(
const CPWL_Wnd::CreateParams& cp,
std::unique_ptr<IPWL_SystemHandler::PerWindowData> pAttachedData) {
- auto pWnd = pdfium::MakeUnique<CPWL_CheckBox>(cp, std::move(pAttachedData));
+ auto pWnd = std::make_unique<CPWL_CheckBox>(cp, std::move(pAttachedData));
pWnd->Realize();
pWnd->SetCheck(m_pWidget->IsChecked());
return std::move(pWnd);
diff --git a/fpdfsdk/formfiller/cffl_combobox.cpp b/fpdfsdk/formfiller/cffl_combobox.cpp
index 5d6dd61..3a04ad6 100644
--- a/fpdfsdk/formfiller/cffl_combobox.cpp
+++ b/fpdfsdk/formfiller/cffl_combobox.cpp
@@ -14,7 +14,6 @@
#include "fpdfsdk/cpdfsdk_widget.h"
#include "fpdfsdk/formfiller/cffl_interactiveformfiller.h"
#include "fpdfsdk/pwl/cpwl_combo_box.h"
-#include "third_party/base/ptr_util.h"
CFFL_ComboBox::CFFL_ComboBox(CPDFSDK_FormFillEnvironment* pApp,
CPDFSDK_Widget* pWidget)
@@ -44,7 +43,7 @@
std::unique_ptr<CPWL_Wnd> CFFL_ComboBox::NewPWLWindow(
const CPWL_Wnd::CreateParams& cp,
std::unique_ptr<IPWL_SystemHandler::PerWindowData> pAttachedData) {
- auto pWnd = pdfium::MakeUnique<CPWL_ComboBox>(cp, std::move(pAttachedData));
+ auto pWnd = std::make_unique<CPWL_ComboBox>(cp, std::move(pAttachedData));
pWnd->AttachFFLData(this);
pWnd->Realize();
diff --git a/fpdfsdk/formfiller/cffl_formfiller.cpp b/fpdfsdk/formfiller/cffl_formfiller.cpp
index 2cfedea..41a6447 100644
--- a/fpdfsdk/formfiller/cffl_formfiller.cpp
+++ b/fpdfsdk/formfiller/cffl_formfiller.cpp
@@ -14,7 +14,6 @@
#include "fpdfsdk/cpdfsdk_formfillenvironment.h"
#include "fpdfsdk/cpdfsdk_pageview.h"
#include "fpdfsdk/cpdfsdk_widget.h"
-#include "third_party/base/ptr_util.h"
CFFL_FormFiller::CFFL_FormFiller(CPDFSDK_FormFillEnvironment* pFormFillEnv,
CPDFSDK_Widget* pWidget)
@@ -343,7 +342,7 @@
return nullptr;
CPWL_Wnd::CreateParams cp = GetCreateParam();
- auto pPrivateData = pdfium::MakeUnique<CFFL_PrivateData>();
+ auto pPrivateData = std::make_unique<CFFL_PrivateData>();
pPrivateData->pWidget.Reset(m_pWidget.Get());
pPrivateData->pPageView = pPageView;
pPrivateData->nWidgetAppearanceAge = m_pWidget->GetAppearanceAge();
diff --git a/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp b/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp
index 8681c30..b8be70e 100644
--- a/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp
+++ b/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp
@@ -23,7 +23,6 @@
#include "fpdfsdk/formfiller/cffl_radiobutton.h"
#include "fpdfsdk/formfiller/cffl_textfield.h"
#include "public/fpdf_fwlevent.h"
-#include "third_party/base/ptr_util.h"
#include "third_party/base/stl_util.h"
CFFL_InteractiveFormFiller::CFFL_InteractiveFormFiller(
@@ -477,27 +476,27 @@
switch (pWidget->GetFieldType()) {
case FormFieldType::kPushButton:
pFormFiller =
- pdfium::MakeUnique<CFFL_PushButton>(m_pFormFillEnv.Get(), pWidget);
+ std::make_unique<CFFL_PushButton>(m_pFormFillEnv.Get(), pWidget);
break;
case FormFieldType::kCheckBox:
pFormFiller =
- pdfium::MakeUnique<CFFL_CheckBox>(m_pFormFillEnv.Get(), pWidget);
+ std::make_unique<CFFL_CheckBox>(m_pFormFillEnv.Get(), pWidget);
break;
case FormFieldType::kRadioButton:
pFormFiller =
- pdfium::MakeUnique<CFFL_RadioButton>(m_pFormFillEnv.Get(), pWidget);
+ std::make_unique<CFFL_RadioButton>(m_pFormFillEnv.Get(), pWidget);
break;
case FormFieldType::kTextField:
pFormFiller =
- pdfium::MakeUnique<CFFL_TextField>(m_pFormFillEnv.Get(), pWidget);
+ std::make_unique<CFFL_TextField>(m_pFormFillEnv.Get(), pWidget);
break;
case FormFieldType::kListBox:
pFormFiller =
- pdfium::MakeUnique<CFFL_ListBox>(m_pFormFillEnv.Get(), pWidget);
+ std::make_unique<CFFL_ListBox>(m_pFormFillEnv.Get(), pWidget);
break;
case FormFieldType::kComboBox:
pFormFiller =
- pdfium::MakeUnique<CFFL_ComboBox>(m_pFormFillEnv.Get(), pWidget);
+ std::make_unique<CFFL_ComboBox>(m_pFormFillEnv.Get(), pWidget);
break;
case FormFieldType::kUnknown:
default:
@@ -976,5 +975,5 @@
std::unique_ptr<IPWL_SystemHandler::PerWindowData> CFFL_PrivateData::Clone()
const {
- return pdfium::MakeUnique<CFFL_PrivateData>(*this);
+ return std::make_unique<CFFL_PrivateData>(*this);
}
diff --git a/fpdfsdk/formfiller/cffl_listbox.cpp b/fpdfsdk/formfiller/cffl_listbox.cpp
index b8339a2..f5990d1 100644
--- a/fpdfsdk/formfiller/cffl_listbox.cpp
+++ b/fpdfsdk/formfiller/cffl_listbox.cpp
@@ -14,7 +14,6 @@
#include "fpdfsdk/cpdfsdk_widget.h"
#include "fpdfsdk/formfiller/cffl_interactiveformfiller.h"
#include "fpdfsdk/pwl/cpwl_list_box.h"
-#include "third_party/base/ptr_util.h"
CFFL_ListBox::CFFL_ListBox(CPDFSDK_FormFillEnvironment* pApp,
CPDFSDK_Widget* pWidget)
@@ -42,7 +41,7 @@
std::unique_ptr<CPWL_Wnd> CFFL_ListBox::NewPWLWindow(
const CPWL_Wnd::CreateParams& cp,
std::unique_ptr<IPWL_SystemHandler::PerWindowData> pAttachedData) {
- auto pWnd = pdfium::MakeUnique<CPWL_ListBox>(cp, std::move(pAttachedData));
+ auto pWnd = std::make_unique<CPWL_ListBox>(cp, std::move(pAttachedData));
pWnd->AttachFFLData(this);
pWnd->Realize();
pWnd->SetFillerNotify(m_pFormFillEnv->GetInteractiveFormFiller());
diff --git a/fpdfsdk/formfiller/cffl_pushbutton.cpp b/fpdfsdk/formfiller/cffl_pushbutton.cpp
index e9872f6..e6a0b5e 100644
--- a/fpdfsdk/formfiller/cffl_pushbutton.cpp
+++ b/fpdfsdk/formfiller/cffl_pushbutton.cpp
@@ -10,7 +10,6 @@
#include "fpdfsdk/formfiller/cffl_formfiller.h"
#include "fpdfsdk/pwl/cpwl_special_button.h"
-#include "third_party/base/ptr_util.h"
CFFL_PushButton::CFFL_PushButton(CPDFSDK_FormFillEnvironment* pApp,
CPDFSDK_Widget* pWidget)
@@ -21,7 +20,7 @@
std::unique_ptr<CPWL_Wnd> CFFL_PushButton::NewPWLWindow(
const CPWL_Wnd::CreateParams& cp,
std::unique_ptr<IPWL_SystemHandler::PerWindowData> pAttachedData) {
- auto pWnd = pdfium::MakeUnique<CPWL_PushButton>(cp, std::move(pAttachedData));
+ auto pWnd = std::make_unique<CPWL_PushButton>(cp, std::move(pAttachedData));
pWnd->Realize();
return std::move(pWnd);
}
diff --git a/fpdfsdk/formfiller/cffl_radiobutton.cpp b/fpdfsdk/formfiller/cffl_radiobutton.cpp
index b7cf32d..90a4fd9 100644
--- a/fpdfsdk/formfiller/cffl_radiobutton.cpp
+++ b/fpdfsdk/formfiller/cffl_radiobutton.cpp
@@ -14,7 +14,6 @@
#include "fpdfsdk/formfiller/cffl_formfiller.h"
#include "fpdfsdk/pwl/cpwl_special_button.h"
#include "public/fpdf_fwlevent.h"
-#include "third_party/base/ptr_util.h"
CFFL_RadioButton::CFFL_RadioButton(CPDFSDK_FormFillEnvironment* pApp,
CPDFSDK_Widget* pWidget)
@@ -25,8 +24,7 @@
std::unique_ptr<CPWL_Wnd> CFFL_RadioButton::NewPWLWindow(
const CPWL_Wnd::CreateParams& cp,
std::unique_ptr<IPWL_SystemHandler::PerWindowData> pAttachedData) {
- auto pWnd =
- pdfium::MakeUnique<CPWL_RadioButton>(cp, std::move(pAttachedData));
+ auto pWnd = std::make_unique<CPWL_RadioButton>(cp, std::move(pAttachedData));
pWnd->Realize();
pWnd->SetCheck(m_pWidget->IsChecked());
return std::move(pWnd);
diff --git a/fpdfsdk/formfiller/cffl_textfield.cpp b/fpdfsdk/formfiller/cffl_textfield.cpp
index a0d352b..93ec9fe 100644
--- a/fpdfsdk/formfiller/cffl_textfield.cpp
+++ b/fpdfsdk/formfiller/cffl_textfield.cpp
@@ -13,7 +13,6 @@
#include "fpdfsdk/cpdfsdk_formfillenvironment.h"
#include "fpdfsdk/cpdfsdk_widget.h"
#include "public/fpdf_fwlevent.h"
-#include "third_party/base/ptr_util.h"
namespace {
@@ -84,7 +83,7 @@
std::unique_ptr<CPWL_Wnd> CFFL_TextField::NewPWLWindow(
const CPWL_Wnd::CreateParams& cp,
std::unique_ptr<IPWL_SystemHandler::PerWindowData> pAttachedData) {
- auto pWnd = pdfium::MakeUnique<CPWL_Edit>(cp, std::move(pAttachedData));
+ auto pWnd = std::make_unique<CPWL_Edit>(cp, std::move(pAttachedData));
pWnd->AttachFFLData(this);
pWnd->Realize();
pWnd->SetFillerNotify(m_pFormFillEnv->GetInteractiveFormFiller());
diff --git a/fpdfsdk/formfiller/cffl_textobject.cpp b/fpdfsdk/formfiller/cffl_textobject.cpp
index 6d84960..161b1da 100644
--- a/fpdfsdk/formfiller/cffl_textobject.cpp
+++ b/fpdfsdk/formfiller/cffl_textobject.cpp
@@ -8,7 +8,6 @@
#include "core/fpdfapi/page/cpdf_page.h"
#include "core/fpdfdoc/cba_fontmap.h"
-#include "third_party/base/ptr_util.h"
CPWL_Wnd* CFFL_TextObject::ResetPWLWindow(CPDFSDK_PageView* pPageView,
bool bRestoreValue) {
@@ -36,9 +35,9 @@
CBA_FontMap* CFFL_TextObject::MaybeCreateFontMap() {
if (!m_pFontMap) {
- m_pFontMap = pdfium::MakeUnique<CBA_FontMap>(
- m_pWidget->GetPDFPage()->GetDocument(),
- m_pWidget->GetPDFAnnot()->GetAnnotDict());
+ m_pFontMap =
+ std::make_unique<CBA_FontMap>(m_pWidget->GetPDFPage()->GetDocument(),
+ m_pWidget->GetPDFAnnot()->GetAnnotDict());
}
return m_pFontMap.get();
}
diff --git a/fpdfsdk/fpdf_annot.cpp b/fpdfsdk/fpdf_annot.cpp
index 2cbab85..c83673b 100644
--- a/fpdfsdk/fpdf_annot.cpp
+++ b/fpdfsdk/fpdf_annot.cpp
@@ -317,7 +317,7 @@
pDict->SetNewFor<CPDF_Name>(pdfium::annotation::kSubtype,
CPDF_Annot::AnnotSubtypeToString(
static_cast<CPDF_Annot::Subtype>(subtype)));
- auto pNewAnnot = pdfium::MakeUnique<CPDF_AnnotContext>(
+ auto pNewAnnot = std::make_unique<CPDF_AnnotContext>(
pDict.Get(), IPDFPageFromFPDFPage(page));
CPDF_Array* pAnnotList = pPage->GetDict()->GetArrayFor("Annots");
@@ -353,7 +353,7 @@
return nullptr;
auto pNewAnnot =
- pdfium::MakeUnique<CPDF_AnnotContext>(pDict, IPDFPageFromFPDFPage(page));
+ std::make_unique<CPDF_AnnotContext>(pDict, IPDFPageFromFPDFPage(page));
// Caller takes ownership.
return FPDFAnnotationFromCPDFAnnotContext(pNewAnnot.release());
@@ -972,7 +972,7 @@
return nullptr;
auto pLinkedAnnot =
- pdfium::MakeUnique<CPDF_AnnotContext>(pLinkedDict, pAnnot->GetPage());
+ std::make_unique<CPDF_AnnotContext>(pLinkedDict, pAnnot->GetPage());
// Caller takes ownership.
return FPDFAnnotationFromCPDFAnnotContext(pLinkedAnnot.release());
diff --git a/fpdfsdk/fpdf_catalog_unittest.cpp b/fpdfsdk/fpdf_catalog_unittest.cpp
index 1ae35b2..2224065 100644
--- a/fpdfsdk/fpdf_catalog_unittest.cpp
+++ b/fpdfsdk/fpdf_catalog_unittest.cpp
@@ -17,13 +17,12 @@
#include "fpdfsdk/cpdfsdk_helpers.h"
#include "public/cpp/fpdf_scopers.h"
#include "testing/gtest/include/gtest/gtest.h"
-#include "third_party/base/ptr_util.h"
class CPDF_TestDocument final : public CPDF_Document {
public:
CPDF_TestDocument()
- : CPDF_Document(pdfium::MakeUnique<CPDF_DocRenderData>(),
- pdfium::MakeUnique<CPDF_DocPageData>()) {}
+ : CPDF_Document(std::make_unique<CPDF_DocRenderData>(),
+ std::make_unique<CPDF_DocPageData>()) {}
void SetRoot(CPDF_Dictionary* root) { SetRootForTesting(root); }
};
@@ -32,7 +31,7 @@
public:
void SetUp() override {
CPDF_PageModule::Create();
- auto pTestDoc = pdfium::MakeUnique<CPDF_TestDocument>();
+ auto pTestDoc = std::make_unique<CPDF_TestDocument>();
m_pDoc.reset(FPDFDocumentFromCPDFDocument(pTestDoc.release()));
m_pRootObj = pdfium::MakeRetain<CPDF_Dictionary>();
}
diff --git a/fpdfsdk/fpdf_dataavail.cpp b/fpdfsdk/fpdf_dataavail.cpp
index 11abff3..9933e51 100644
--- a/fpdfsdk/fpdf_dataavail.cpp
+++ b/fpdfsdk/fpdf_dataavail.cpp
@@ -18,7 +18,6 @@
#include "core/fxcrt/retain_ptr.h"
#include "fpdfsdk/cpdfsdk_helpers.h"
#include "public/fpdf_formfill.h"
-#include "third_party/base/ptr_util.h"
#ifdef PDF_ENABLE_XFA
#include "fpdfsdk/fpdfxfa/cpdfxfa_context.h"
@@ -116,11 +115,11 @@
class FPDF_AvailContext {
public:
FPDF_AvailContext(FX_FILEAVAIL* file_avail, FPDF_FILEACCESS* file)
- : file_avail_(pdfium::MakeUnique<FPDF_FileAvailContext>(file_avail)),
+ : file_avail_(std::make_unique<FPDF_FileAvailContext>(file_avail)),
file_read_(pdfium::MakeRetain<FPDF_FileAccessContext>(file)),
- data_avail_(pdfium::MakeUnique<CPDF_DataAvail>(file_avail_.get(),
- file_read_,
- true)) {}
+ data_avail_(std::make_unique<CPDF_DataAvail>(file_avail_.get(),
+ file_read_,
+ true)) {}
~FPDF_AvailContext() = default;
CPDF_DataAvail* data_avail() { return data_avail_.get(); }
@@ -139,7 +138,7 @@
FPDF_EXPORT FPDF_AVAIL FPDF_CALLCONV FPDFAvail_Create(FX_FILEAVAIL* file_avail,
FPDF_FILEACCESS* file) {
- auto pAvail = pdfium::MakeUnique<FPDF_AvailContext>(file_avail, file);
+ auto pAvail = std::make_unique<FPDF_AvailContext>(file_avail, file);
return pAvail.release(); // Caller takes ownership.
}
@@ -165,15 +164,15 @@
CPDF_Parser::Error error;
std::unique_ptr<CPDF_Document> document;
std::tie(error, document) = avail_context->data_avail()->ParseDocument(
- pdfium::MakeUnique<CPDF_DocRenderData>(),
- pdfium::MakeUnique<CPDF_DocPageData>(), password);
+ std::make_unique<CPDF_DocRenderData>(),
+ std::make_unique<CPDF_DocPageData>(), password);
if (error != CPDF_Parser::SUCCESS) {
ProcessParseError(error);
return nullptr;
}
#ifdef PDF_ENABLE_XFA
- document->SetExtension(pdfium::MakeUnique<CPDFXFA_Context>(document.get()));
+ document->SetExtension(std::make_unique<CPDFXFA_Context>(document.get()));
#endif // PDF_ENABLE_XFA
ReportUnsupportedFeatures(document.get());
diff --git a/fpdfsdk/fpdf_doc.cpp b/fpdfsdk/fpdf_doc.cpp
index add8825..a17ec82 100644
--- a/fpdfsdk/fpdf_doc.cpp
+++ b/fpdfsdk/fpdf_doc.cpp
@@ -23,7 +23,6 @@
#include "core/fpdfdoc/cpdf_linklist.h"
#include "core/fpdfdoc/cpdf_pagelabel.h"
#include "fpdfsdk/cpdfsdk_helpers.h"
-#include "third_party/base/ptr_util.h"
#include "third_party/base/stl_util.h"
namespace {
@@ -61,7 +60,7 @@
if (pList)
return pList;
- auto pNewList = pdfium::MakeUnique<CPDF_LinkList>();
+ auto pNewList = std::make_unique<CPDF_LinkList>();
pList = pNewList.get();
pDoc->SetLinksContext(std::move(pNewList));
return pList;
@@ -258,7 +257,7 @@
if (!dest)
return false;
- auto destination = pdfium::MakeUnique<CPDF_Dest>(CPDFArrayFromFPDFDest(dest));
+ auto destination = std::make_unique<CPDF_Dest>(CPDFArrayFromFPDFDest(dest));
// FPDF_BOOL is an int, GetXYZ expects bools.
bool bHasX;
diff --git a/fpdfsdk/fpdf_doc_unittest.cpp b/fpdfsdk/fpdf_doc_unittest.cpp
index c911096..6b3d992 100644
--- a/fpdfsdk/fpdf_doc_unittest.cpp
+++ b/fpdfsdk/fpdf_doc_unittest.cpp
@@ -24,13 +24,12 @@
#include "public/cpp/fpdf_scopers.h"
#include "testing/fx_string_testhelpers.h"
#include "testing/gtest/include/gtest/gtest.h"
-#include "third_party/base/ptr_util.h"
class CPDF_TestDocument final : public CPDF_Document {
public:
CPDF_TestDocument()
- : CPDF_Document(pdfium::MakeUnique<CPDF_DocRenderData>(),
- pdfium::MakeUnique<CPDF_DocPageData>()) {}
+ : CPDF_Document(std::make_unique<CPDF_DocRenderData>(),
+ std::make_unique<CPDF_DocPageData>()) {}
void SetRoot(CPDF_Dictionary* root) { SetRootForTesting(root); }
CPDF_IndirectObjectHolder* GetHolder() { return this; }
@@ -45,7 +44,7 @@
void SetUp() override {
CPDF_PageModule::Create();
- auto pTestDoc = pdfium::MakeUnique<CPDF_TestDocument>();
+ auto pTestDoc = std::make_unique<CPDF_TestDocument>();
m_pIndirectObjs = pTestDoc->GetHolder();
m_pRootObj.Reset(m_pIndirectObjs->NewIndirect<CPDF_Dictionary>());
pTestDoc->SetRoot(m_pRootObj.Get());
diff --git a/fpdfsdk/fpdf_editimg.cpp b/fpdfsdk/fpdf_editimg.cpp
index 1e0e560..7637bf9 100644
--- a/fpdfsdk/fpdf_editimg.cpp
+++ b/fpdfsdk/fpdf_editimg.cpp
@@ -6,6 +6,7 @@
#include "public/fpdf_edit.h"
+#include <memory>
#include <utility>
#include "core/fpdfapi/page/cpdf_dib.h"
@@ -19,7 +20,6 @@
#include "core/fpdfapi/parser/cpdf_stream_acc.h"
#include "fpdfsdk/cpdfsdk_customaccess.h"
#include "fpdfsdk/cpdfsdk_helpers.h"
-#include "third_party/base/ptr_util.h"
namespace {
@@ -95,7 +95,7 @@
if (!pDoc)
return nullptr;
- auto pImageObj = pdfium::MakeUnique<CPDF_ImageObject>();
+ auto pImageObj = std::make_unique<CPDF_ImageObject>();
pImageObj->SetImage(pdfium::MakeRetain<CPDF_Image>(pDoc));
// Caller takes ownership.
diff --git a/fpdfsdk/fpdf_editpage.cpp b/fpdfsdk/fpdf_editpage.cpp
index 1590152..eb27a51 100644
--- a/fpdfsdk/fpdf_editpage.cpp
+++ b/fpdfsdk/fpdf_editpage.cpp
@@ -35,7 +35,6 @@
#include "fpdfsdk/cpdfsdk_helpers.h"
#include "public/fpdf_formfill.h"
#include "third_party/base/logging.h"
-#include "third_party/base/ptr_util.h"
#include "third_party/base/stl_util.h"
#ifdef PDF_ENABLE_XFA
@@ -150,9 +149,9 @@
} // namespace
FPDF_EXPORT FPDF_DOCUMENT FPDF_CALLCONV FPDF_CreateNewDocument() {
- auto pDoc = pdfium::MakeUnique<CPDF_Document>(
- pdfium::MakeUnique<CPDF_DocRenderData>(),
- pdfium::MakeUnique<CPDF_DocPageData>());
+ auto pDoc =
+ std::make_unique<CPDF_Document>(std::make_unique<CPDF_DocRenderData>(),
+ std::make_unique<CPDF_DocPageData>());
pDoc->CreateNewDoc();
time_t currentTime;
@@ -176,7 +175,7 @@
}
#ifdef PDF_ENABLE_XFA
- pDoc->SetExtension(pdfium::MakeUnique<CPDFXFA_Context>(pDoc.get()));
+ pDoc->SetExtension(std::make_unique<CPDFXFA_Context>(pDoc.get()));
#endif // PDF_ENABLE_XFA
// Caller takes ownership of pDoc.
@@ -225,7 +224,7 @@
#endif // PDF_ENABLE_XFA
auto pPage = pdfium::MakeRetain<CPDF_Page>(pDoc, pPageDict);
- pPage->SetRenderCache(pdfium::MakeUnique<CPDF_PageRenderCache>(pPage.Get()));
+ pPage->SetRenderCache(std::make_unique<CPDF_PageRenderCache>(pPage.Get()));
pPage->ParseContent();
return FPDFPageFromIPDFPage(pPage.Leak()); // Caller takes ownership.
diff --git a/fpdfsdk/fpdf_editpath.cpp b/fpdfsdk/fpdf_editpath.cpp
index 18c3477..b311869 100644
--- a/fpdfsdk/fpdf_editpath.cpp
+++ b/fpdfsdk/fpdf_editpath.cpp
@@ -4,6 +4,7 @@
#include "public/fpdf_edit.h"
+#include <memory>
#include <utility>
#include <vector>
@@ -11,7 +12,6 @@
#include "core/fpdfapi/page/cpdf_pathobject.h"
#include "core/fxcrt/fx_system.h"
#include "fpdfsdk/cpdfsdk_helpers.h"
-#include "third_party/base/ptr_util.h"
#include "third_party/base/span.h"
#include "third_party/base/stl_util.h"
@@ -49,7 +49,7 @@
FPDF_EXPORT FPDF_PAGEOBJECT FPDF_CALLCONV FPDFPageObj_CreateNewPath(float x,
float y) {
- auto pPathObj = pdfium::MakeUnique<CPDF_PathObject>();
+ auto pPathObj = std::make_unique<CPDF_PathObject>();
pPathObj->path().AppendPoint(CFX_PointF(x, y), FXPT_TYPE::MoveTo);
pPathObj->DefaultStates();
@@ -61,7 +61,7 @@
float y,
float w,
float h) {
- auto pPathObj = pdfium::MakeUnique<CPDF_PathObject>();
+ auto pPathObj = std::make_unique<CPDF_PathObject>();
pPathObj->path().AppendRect(x, y, x + w, y + h);
pPathObj->DefaultStates();
diff --git a/fpdfsdk/fpdf_edittext.cpp b/fpdfsdk/fpdf_edittext.cpp
index f7580be..91833d9 100644
--- a/fpdfsdk/fpdf_edittext.cpp
+++ b/fpdfsdk/fpdf_edittext.cpp
@@ -28,7 +28,6 @@
#include "core/fxge/fx_font.h"
#include "fpdfsdk/cpdfsdk_helpers.h"
#include "public/fpdf_edit.h"
-#include "third_party/base/ptr_util.h"
#include "third_party/base/stl_util.h"
// These checks are here because core/ and public/ cannot depend on each other.
@@ -456,7 +455,7 @@
if (!pFont)
return nullptr;
- auto pTextObj = pdfium::MakeUnique<CPDF_TextObject>();
+ auto pTextObj = std::make_unique<CPDF_TextObject>();
pTextObj->m_TextState.SetFont(pFont);
pTextObj->m_TextState.SetFontSize(font_size);
pTextObj->DefaultStates();
@@ -493,7 +492,7 @@
}
auto span = pdfium::make_span(data, size);
- auto pFont = pdfium::MakeUnique<CFX_Font>();
+ auto pFont = std::make_unique<CFX_Font>();
// TODO(npm): Maybe use FT_Get_X11_Font_Format to check format? Otherwise, we
// are allowing giving any font that can be loaded on freetype and setting it
@@ -585,7 +584,7 @@
if (!pDoc || !pFont)
return nullptr;
- auto pTextObj = pdfium::MakeUnique<CPDF_TextObject>();
+ auto pTextObj = std::make_unique<CPDF_TextObject>();
pTextObj->m_TextState.SetFont(
CPDF_DocPageData::FromDocument(pDoc)->GetFont(pFont->GetFontDict()));
pTextObj->m_TextState.SetFontSize(font_size);
diff --git a/fpdfsdk/fpdf_formfill.cpp b/fpdfsdk/fpdf_formfill.cpp
index 65a5d4e..7f10251 100644
--- a/fpdfsdk/fpdf_formfill.cpp
+++ b/fpdfsdk/fpdf_formfill.cpp
@@ -29,7 +29,6 @@
#include "fpdfsdk/cpdfsdk_pageview.h"
#include "fpdfsdk/cpdfsdk_widgethandler.h"
#include "public/fpdfview.h"
-#include "third_party/base/ptr_util.h"
#ifdef PDF_ENABLE_XFA
#include "fpdfsdk/fpdfxfa/cpdfxfa_context.h"
@@ -196,7 +195,7 @@
const FX_RECT rect(start_x, start_y, start_x + size_x, start_y + size_y);
CFX_Matrix matrix = pPage->GetDisplayMatrix(rect, rotate);
- auto pDevice = pdfium::MakeUnique<CFX_DefaultRenderDevice>();
+ auto pDevice = std::make_unique<CFX_DefaultRenderDevice>();
#ifdef _SKIA_SUPPORT_
pDevice->AttachRecorder(static_cast<SkPictureRecorder*>(recorder));
#endif
@@ -313,7 +312,7 @@
CPDFXFA_Context* pContext = nullptr;
if (!formInfo->xfa_disabled) {
if (!pDocument->GetExtension()) {
- pDocument->SetExtension(pdfium::MakeUnique<CPDFXFA_Context>(pDocument));
+ pDocument->SetExtension(std::make_unique<CPDFXFA_Context>(pDocument));
}
// If the CPDFXFA_Context has a FormFillEnvironment already then we've done
@@ -324,15 +323,15 @@
return FPDFFormHandleFromCPDFSDKFormFillEnvironment(
pContext->GetFormFillEnv());
}
- pXFAHandler = pdfium::MakeUnique<CPDFXFA_WidgetHandler>();
+ pXFAHandler = std::make_unique<CPDFXFA_WidgetHandler>();
}
#endif // PDF_ENABLE_XFA
- auto pFormFillEnv = pdfium::MakeUnique<CPDFSDK_FormFillEnvironment>(
+ auto pFormFillEnv = std::make_unique<CPDFSDK_FormFillEnvironment>(
pDocument, formInfo,
- pdfium::MakeUnique<CPDFSDK_AnnotHandlerMgr>(
- pdfium::MakeUnique<CPDFSDK_BAAnnotHandler>(),
- pdfium::MakeUnique<CPDFSDK_WidgetHandler>(), std::move(pXFAHandler)));
+ std::make_unique<CPDFSDK_AnnotHandlerMgr>(
+ std::make_unique<CPDFSDK_BAAnnotHandler>(),
+ std::make_unique<CPDFSDK_WidgetHandler>(), std::move(pXFAHandler)));
#ifdef PDF_ENABLE_XFA
if (pContext)
@@ -621,7 +620,7 @@
return true;
CPDF_Dictionary* annot_dict = cpdfsdk_annot->GetPDFAnnot()->GetAnnotDict();
- auto annot_context = pdfium::MakeUnique<CPDF_AnnotContext>(annot_dict, page);
+ auto annot_context = std::make_unique<CPDF_AnnotContext>(annot_dict, page);
*page_index = page_view->GetPageIndex();
// Caller takes ownership.
diff --git a/fpdfsdk/fpdf_javascript.cpp b/fpdfsdk/fpdf_javascript.cpp
index ebe8008..0aaae81 100644
--- a/fpdfsdk/fpdf_javascript.cpp
+++ b/fpdfsdk/fpdf_javascript.cpp
@@ -11,7 +11,6 @@
#include "core/fpdfdoc/cpdf_action.h"
#include "core/fpdfdoc/cpdf_nametree.h"
#include "fpdfsdk/cpdfsdk_helpers.h"
-#include "third_party/base/ptr_util.h"
struct CPDF_JavaScript {
WideString name;
@@ -53,7 +52,7 @@
if (!script.has_value())
return nullptr;
- auto js = pdfium::MakeUnique<CPDF_JavaScript>();
+ auto js = std::make_unique<CPDF_JavaScript>();
js->name = name;
js->script = script.value();
return FPDFJavaScriptActionFromCPDFJavaScriptAction(js.release());
diff --git a/fpdfsdk/fpdf_ppo.cpp b/fpdfsdk/fpdf_ppo.cpp
index 819ba05..43a45e2 100644
--- a/fpdfsdk/fpdf_ppo.cpp
+++ b/fpdfsdk/fpdf_ppo.cpp
@@ -31,7 +31,6 @@
#include "core/fxcrt/unowned_ptr.h"
#include "fpdfsdk/cpdfsdk_helpers.h"
#include "public/cpp/fpdf_scopers.h"
-#include "third_party/base/ptr_util.h"
namespace {
@@ -623,7 +622,7 @@
auto pSrcPage = pdfium::MakeRetain<CPDF_Page>(src(), pSrcPageDict);
pSrcPage->SetRenderCache(
- pdfium::MakeUnique<CPDF_PageRenderCache>(pSrcPage.Get()));
+ std::make_unique<CPDF_PageRenderCache>(pSrcPage.Get()));
NupPageSettings settings =
nupState.CalculateNewPagePosition(pSrcPage->GetPageSize());
bsContent += AddSubPage(pSrcPageDict, settings);
diff --git a/fpdfsdk/fpdf_progressive.cpp b/fpdfsdk/fpdf_progressive.cpp
index 7221b27..4ccc738 100644
--- a/fpdfsdk/fpdf_progressive.cpp
+++ b/fpdfsdk/fpdf_progressive.cpp
@@ -6,6 +6,7 @@
#include "public/fpdf_progressive.h"
+#include <memory>
#include <utility>
#include "core/fpdfapi/page/cpdf_page.h"
@@ -16,7 +17,6 @@
#include "fpdfsdk/cpdfsdk_pauseadapter.h"
#include "fpdfsdk/cpdfsdk_renderpage.h"
#include "public/fpdfview.h"
-#include "third_party/base/ptr_util.h"
#ifdef _SKIA_SUPPORT_PATHS_
#include "core/fxge/cfx_renderdevice.h"
@@ -59,12 +59,12 @@
if (!pPage)
return FPDF_RENDER_FAILED;
- auto pOwnedContext = pdfium::MakeUnique<CPDF_PageRenderContext>();
+ auto pOwnedContext = std::make_unique<CPDF_PageRenderContext>();
CPDF_PageRenderContext* pContext = pOwnedContext.get();
pPage->SetRenderContext(std::move(pOwnedContext));
RetainPtr<CFX_DIBitmap> pBitmap(CFXDIBitmapFromFPDFBitmap(bitmap));
- auto pOwnedDevice = pdfium::MakeUnique<CFX_DefaultRenderDevice>();
+ auto pOwnedDevice = std::make_unique<CFX_DefaultRenderDevice>();
CFX_DefaultRenderDevice* pDevice = pOwnedDevice.get();
pContext->m_pDevice = std::move(pOwnedDevice);
pDevice->Attach(pBitmap, !!(flags & FPDF_REVERSE_BYTE_ORDER), nullptr, false);
diff --git a/fpdfsdk/fpdf_sysfontinfo.cpp b/fpdfsdk/fpdf_sysfontinfo.cpp
index 96ceef2..0b5c8e6 100644
--- a/fpdfsdk/fpdf_sysfontinfo.cpp
+++ b/fpdfsdk/fpdf_sysfontinfo.cpp
@@ -17,7 +17,6 @@
#include "core/fxge/cfx_gemodule.h"
#include "core/fxge/fx_font.h"
#include "core/fxge/systemfontinfo_iface.h"
-#include "third_party/base/ptr_util.h"
static_assert(FXFONT_ANSI_CHARSET == FX_CHARSET_ANSI, "Charset must match");
static_assert(FXFONT_DEFAULT_CHARSET == FX_CHARSET_Default,
@@ -134,7 +133,7 @@
return;
CFX_GEModule::Get()->GetFontMgr()->SetSystemFontInfo(
- pdfium::MakeUnique<CFX_ExternalFontInfo>(pFontInfoExt));
+ std::make_unique<CFX_ExternalFontInfo>(pFontInfoExt));
}
FPDF_EXPORT const FPDF_CharsetFontMap* FPDF_CALLCONV FPDF_GetDefaultTTFMap() {
diff --git a/fpdfsdk/fpdf_text.cpp b/fpdfsdk/fpdf_text.cpp
index 5edbf27..5b5ca93 100644
--- a/fpdfsdk/fpdf_text.cpp
+++ b/fpdfsdk/fpdf_text.cpp
@@ -21,7 +21,6 @@
#include "core/fpdftext/cpdf_textpagefind.h"
#include "fpdfsdk/cpdfsdk_helpers.h"
#include "third_party/base/numerics/safe_conversions.h"
-#include "third_party/base/ptr_util.h"
#include "third_party/base/stl_util.h"
#if defined(OS_WIN)
@@ -49,7 +48,7 @@
CPDF_ViewerPreferences viewRef(pPDFPage->GetDocument());
auto textpage =
- pdfium::MakeUnique<CPDF_TextPage>(pPDFPage, viewRef.IsDirectionR2L());
+ std::make_unique<CPDF_TextPage>(pPDFPage, viewRef.IsDirectionR2L());
// Caller takes ownership.
return FPDFTextPageFromCPDFTextPage(textpage.release());
@@ -490,7 +489,7 @@
return nullptr;
CPDF_TextPage* pPage = CPDFTextPageFromFPDFTextPage(text_page);
- auto pageLink = pdfium::MakeUnique<CPDF_LinkExtract>(pPage);
+ auto pageLink = std::make_unique<CPDF_LinkExtract>(pPage);
pageLink->ExtractLinks();
// Caller takes ownership.
diff --git a/fpdfsdk/fpdf_transformpage.cpp b/fpdfsdk/fpdf_transformpage.cpp
index 0afd461..1d6712e 100644
--- a/fpdfsdk/fpdf_transformpage.cpp
+++ b/fpdfsdk/fpdf_transformpage.cpp
@@ -25,7 +25,6 @@
#include "core/fxge/cfx_pathdata.h"
#include "core/fxge/render_defines.h"
#include "fpdfsdk/cpdfsdk_helpers.h"
-#include "third_party/base/ptr_util.h"
#include "third_party/base/span.h"
#include "third_party/base/stl_util.h"
@@ -368,7 +367,7 @@
CPDF_Path Path;
Path.AppendRect(left, bottom, right, top);
- auto pNewClipPath = pdfium::MakeUnique<CPDF_ClipPath>();
+ auto pNewClipPath = std::make_unique<CPDF_ClipPath>();
pNewClipPath->AppendPath(Path, FXFILL_ALTERNATE, false);
// Caller takes ownership.
diff --git a/fpdfsdk/fpdf_view.cpp b/fpdfsdk/fpdf_view.cpp
index eddd0db..0eddaf8 100644
--- a/fpdfsdk/fpdf_view.cpp
+++ b/fpdfsdk/fpdf_view.cpp
@@ -90,9 +90,9 @@
return nullptr;
}
- auto pDocument = pdfium::MakeUnique<CPDF_Document>(
- pdfium::MakeUnique<CPDF_DocRenderData>(),
- pdfium::MakeUnique<CPDF_DocPageData>());
+ auto pDocument =
+ std::make_unique<CPDF_Document>(std::make_unique<CPDF_DocRenderData>(),
+ std::make_unique<CPDF_DocPageData>());
CPDF_Parser::Error error = pDocument->LoadDoc(pFileAccess, password);
if (error != CPDF_Parser::SUCCESS) {
@@ -307,7 +307,7 @@
return nullptr;
auto pPage = pdfium::MakeRetain<CPDF_Page>(pDoc, pDict);
- pPage->SetRenderCache(pdfium::MakeUnique<CPDF_PageRenderCache>(pPage.Get()));
+ pPage->SetRenderCache(std::make_unique<CPDF_PageRenderCache>(pPage.Get()));
pPage->ParseContent();
return FPDFPageFromIPDFPage(pPage.Leak());
}
@@ -439,7 +439,7 @@
if (!pPage)
return;
- auto pOwnedContext = pdfium::MakeUnique<CPDF_PageRenderContext>();
+ auto pOwnedContext = std::make_unique<CPDF_PageRenderContext>();
CPDF_PageRenderContext* pContext = pOwnedContext.get();
CPDF_Page::RenderContextClearer clearer(pPage);
pPage->SetRenderContext(std::move(pOwnedContext));
@@ -456,7 +456,7 @@
pPage->GetMaskBoundingBoxes().size() > 100;
const bool bHasMask = pPage->HasImageMask() && !bNewBitmap;
if (!bNewBitmap && !bHasMask) {
- pContext->m_pDevice = pdfium::MakeUnique<CPDF_WindowsRenderDevice>(dc);
+ pContext->m_pDevice = std::make_unique<CPDF_WindowsRenderDevice>(dc);
CPDFSDK_RenderPageWithContext(pContext, pPage, start_x, start_y, size_x,
size_y, rotate, flags,
/*color_scheme=*/nullptr,
@@ -473,7 +473,7 @@
pContext->m_pDevice = pdfium::WrapUnique(pDevice);
pDevice->Attach(pBitmap, false, nullptr, false);
if (bHasMask) {
- pContext->m_pOptions = pdfium::MakeUnique<CPDF_RenderOptions>();
+ pContext->m_pOptions = std::make_unique<CPDF_RenderOptions>();
pContext->m_pOptions->GetOptions().bBreakForMasks = true;
}
@@ -513,11 +513,11 @@
// Begin rendering to the printer. Add flag to indicate the renderer should
// pause after each image mask.
- pOwnedContext = pdfium::MakeUnique<CPDF_PageRenderContext>();
+ pOwnedContext = std::make_unique<CPDF_PageRenderContext>();
pContext = pOwnedContext.get();
pPage->SetRenderContext(std::move(pOwnedContext));
- pContext->m_pDevice = pdfium::MakeUnique<CPDF_WindowsRenderDevice>(dc);
- pContext->m_pOptions = pdfium::MakeUnique<CPDF_RenderOptions>();
+ pContext->m_pDevice = std::make_unique<CPDF_WindowsRenderDevice>(dc);
+ pContext->m_pOptions = std::make_unique<CPDF_RenderOptions>();
pContext->m_pOptions->GetOptions().bBreakForMasks = true;
CPDFSDK_RenderPageWithContext(pContext, pPage, start_x, start_y, size_x,
@@ -552,12 +552,12 @@
if (!pPage)
return;
- auto pOwnedContext = pdfium::MakeUnique<CPDF_PageRenderContext>();
+ auto pOwnedContext = std::make_unique<CPDF_PageRenderContext>();
CPDF_PageRenderContext* pContext = pOwnedContext.get();
CPDF_Page::RenderContextClearer clearer(pPage);
pPage->SetRenderContext(std::move(pOwnedContext));
- auto pOwnedDevice = pdfium::MakeUnique<CFX_DefaultRenderDevice>();
+ auto pOwnedDevice = std::make_unique<CFX_DefaultRenderDevice>();
CFX_DefaultRenderDevice* pDevice = pOwnedDevice.get();
pContext->m_pDevice = std::move(pOwnedDevice);
@@ -587,12 +587,12 @@
if (!pPage)
return;
- auto pOwnedContext = pdfium::MakeUnique<CPDF_PageRenderContext>();
+ auto pOwnedContext = std::make_unique<CPDF_PageRenderContext>();
CPDF_PageRenderContext* pContext = pOwnedContext.get();
CPDF_Page::RenderContextClearer clearer(pPage);
pPage->SetRenderContext(std::move(pOwnedContext));
- auto pOwnedDevice = pdfium::MakeUnique<CFX_DefaultRenderDevice>();
+ auto pOwnedDevice = std::make_unique<CFX_DefaultRenderDevice>();
CFX_DefaultRenderDevice* pDevice = pOwnedDevice.get();
pContext->m_pDevice = std::move(pOwnedDevice);
@@ -620,12 +620,12 @@
if (!pPage)
return nullptr;
- auto pOwnedContext = pdfium::MakeUnique<CPDF_PageRenderContext>();
+ auto pOwnedContext = std::make_unique<CPDF_PageRenderContext>();
CPDF_PageRenderContext* pContext = pOwnedContext.get();
CPDF_Page::RenderContextClearer clearer(pPage);
pPage->SetRenderContext(std::move(pOwnedContext));
- auto skDevice = pdfium::MakeUnique<CFX_DefaultRenderDevice>();
+ auto skDevice = std::make_unique<CFX_DefaultRenderDevice>();
FPDF_RECORDER recorder = skDevice->CreateRecorder(size_x, size_y);
pContext->m_pDevice = std::move(skDevice);
@@ -855,7 +855,7 @@
return false;
auto page = pdfium::MakeRetain<CPDF_Page>(pDoc, pDict);
- page->SetRenderCache(pdfium::MakeUnique<CPDF_PageRenderCache>(page.Get()));
+ page->SetRenderCache(std::make_unique<CPDF_PageRenderCache>(page.Get()));
size->width = page->GetPageWidth();
size->height = page->GetPageHeight();
return true;
diff --git a/fpdfsdk/fpdfxfa/cpdfxfa_context.cpp b/fpdfsdk/fpdfxfa/cpdfxfa_context.cpp
index a530182..e6cfdfb 100644
--- a/fpdfsdk/fpdfxfa/cpdfxfa_context.cpp
+++ b/fpdfsdk/fpdfxfa/cpdfxfa_context.cpp
@@ -20,7 +20,6 @@
#include "fxjs/cjs_runtime.h"
#include "fxjs/ijs_runtime.h"
#include "public/fpdf_formfill.h"
-#include "third_party/base/ptr_util.h"
#include "third_party/base/stl_util.h"
#include "xfa/fxfa/cxfa_eventparam.h"
#include "xfa/fxfa/cxfa_ffapp.h"
@@ -82,7 +81,7 @@
CPDFXFA_Context::CPDFXFA_Context(CPDF_Document* pPDFDoc)
: m_pPDFDoc(pPDFDoc),
- m_pXFAApp(pdfium::MakeUnique<CXFA_FFApp>(this)),
+ m_pXFAApp(std::make_unique<CXFA_FFApp>(this)),
m_DocEnv(this) {
ASSERT(m_pPDFDoc);
}
diff --git a/fpdfsdk/fpdfxfa/cpdfxfa_page.cpp b/fpdfsdk/fpdfxfa/cpdfxfa_page.cpp
index fc9cf9d..02b5f75 100644
--- a/fpdfsdk/fpdfxfa/cpdfxfa_page.cpp
+++ b/fpdfsdk/fpdfxfa/cpdfxfa_page.cpp
@@ -14,7 +14,6 @@
#include "fpdfsdk/cpdfsdk_pageview.h"
#include "fpdfsdk/fpdfxfa/cpdfxfa_context.h"
#include "fpdfsdk/fpdfxfa/cpdfxfa_widget.h"
-#include "third_party/base/ptr_util.h"
#include "xfa/fxfa/cxfa_ffdocview.h"
#include "xfa/fxfa/cxfa_ffpageview.h"
#include "xfa/fxfa/cxfa_ffwidget.h"
@@ -78,7 +77,7 @@
ASSERT(pPageDict);
m_pPDFPage = pdfium::MakeRetain<CPDF_Page>(GetDocument(), pPageDict);
m_pPDFPage->SetRenderCache(
- pdfium::MakeUnique<CPDF_PageRenderCache>(m_pPDFPage.Get()));
+ std::make_unique<CPDF_PageRenderCache>(m_pPDFPage.Get()));
m_pPDFPage->ParseContent();
}
diff --git a/fpdfsdk/fpdfxfa/cpdfxfa_widgethandler.cpp b/fpdfsdk/fpdfxfa/cpdfxfa_widgethandler.cpp
index 5a49b92..8cc6198 100644
--- a/fpdfsdk/fpdfxfa/cpdfxfa_widgethandler.cpp
+++ b/fpdfsdk/fpdfxfa/cpdfxfa_widgethandler.cpp
@@ -13,7 +13,6 @@
#include "fpdfsdk/fpdfxfa/cpdfxfa_context.h"
#include "fpdfsdk/fpdfxfa/cpdfxfa_widget.h"
#include "public/fpdf_fwlevent.h"
-#include "third_party/base/ptr_util.h"
#include "xfa/fwl/cfwl_app.h"
#include "xfa/fwl/fwl_widgetdef.h"
#include "xfa/fwl/fwl_widgethit.h"
@@ -225,7 +224,7 @@
CXFA_FFWidget* pAnnot,
CPDFSDK_PageView* pPageView) {
CPDFSDK_InteractiveForm* pForm = m_pFormFillEnv->GetInteractiveForm();
- return pdfium::MakeUnique<CPDFXFA_Widget>(pAnnot, pPageView, pForm);
+ return std::make_unique<CPDFXFA_Widget>(pAnnot, pPageView, pForm);
}
void CPDFXFA_WidgetHandler::OnDraw(CPDFSDK_PageView* pPageView,
diff --git a/fpdfsdk/pwl/cpwl_caret.cpp b/fpdfsdk/pwl/cpwl_caret.cpp
index cc6ae8a..87b79ee 100644
--- a/fpdfsdk/pwl/cpwl_caret.cpp
+++ b/fpdfsdk/pwl/cpwl_caret.cpp
@@ -12,7 +12,6 @@
#include "core/fxge/cfx_graphstatedata.h"
#include "core/fxge/cfx_pathdata.h"
#include "core/fxge/cfx_renderdevice.h"
-#include "third_party/base/ptr_util.h"
CPWL_Caret::CPWL_Caret(
const CreateParams& cp,
@@ -85,8 +84,8 @@
m_ptHead = ptHead;
m_ptFoot = ptFoot;
- m_pTimer = pdfium::MakeUnique<CFX_Timer>(GetTimerHandler(), this,
- kCaretFlashIntervalMs);
+ m_pTimer = std::make_unique<CFX_Timer>(GetTimerHandler(), this,
+ kCaretFlashIntervalMs);
if (!CPWL_Wnd::SetVisible(true))
return;
diff --git a/fpdfsdk/pwl/cpwl_combo_box.cpp b/fpdfsdk/pwl/cpwl_combo_box.cpp
index 1f99143..a821d0c 100644
--- a/fpdfsdk/pwl/cpwl_combo_box.cpp
+++ b/fpdfsdk/pwl/cpwl_combo_box.cpp
@@ -18,7 +18,6 @@
#include "fpdfsdk/pwl/cpwl_list_impl.h"
#include "fpdfsdk/pwl/cpwl_wnd.h"
#include "public/fpdf_fwlevent.h"
-#include "third_party/base/ptr_util.h"
namespace {
@@ -288,7 +287,7 @@
ecp.dwBorderWidth = 0;
ecp.nBorderStyle = BorderStyle::SOLID;
- auto pEdit = pdfium::MakeUnique<CPWL_Edit>(ecp, CloneAttachedData());
+ auto pEdit = std::make_unique<CPWL_Edit>(ecp, CloneAttachedData());
m_pEdit = pEdit.get();
m_pEdit->AttachFFLData(m_pFormFiller.Get());
AddChild(std::move(pEdit));
@@ -308,7 +307,7 @@
bcp.nBorderStyle = BorderStyle::BEVELED;
bcp.eCursorType = FXCT_ARROW;
- auto pButton = pdfium::MakeUnique<CPWL_CBButton>(bcp, CloneAttachedData());
+ auto pButton = std::make_unique<CPWL_CBButton>(bcp, CloneAttachedData());
m_pButton = pButton.get();
AddChild(std::move(pButton));
m_pButton->Realize();
@@ -335,7 +334,7 @@
if (cp.sBackgroundColor.nColorType == CFX_Color::kTransparent)
lcp.sBackgroundColor = PWL_DEFAULT_WHITECOLOR;
- auto pList = pdfium::MakeUnique<CPWL_CBListBox>(lcp, CloneAttachedData());
+ auto pList = std::make_unique<CPWL_CBListBox>(lcp, CloneAttachedData());
m_pList = pList.get();
m_pList->AttachFFLData(m_pFormFiller.Get());
AddChild(std::move(pList));
diff --git a/fpdfsdk/pwl/cpwl_edit_ctrl.cpp b/fpdfsdk/pwl/cpwl_edit_ctrl.cpp
index d62c7c6..701f4a3 100644
--- a/fpdfsdk/pwl/cpwl_edit_ctrl.cpp
+++ b/fpdfsdk/pwl/cpwl_edit_ctrl.cpp
@@ -15,13 +15,12 @@
#include "fpdfsdk/pwl/cpwl_scroll_bar.h"
#include "fpdfsdk/pwl/cpwl_wnd.h"
#include "public/fpdf_fwlevent.h"
-#include "third_party/base/ptr_util.h"
CPWL_EditCtrl::CPWL_EditCtrl(
const CreateParams& cp,
std::unique_ptr<IPWL_SystemHandler::PerWindowData> pAttachedData)
: CPWL_Wnd(cp, std::move(pAttachedData)),
- m_pEdit(pdfium::MakeUnique<CPWL_EditImpl>()) {
+ m_pEdit(std::make_unique<CPWL_EditImpl>()) {
GetCreationParams()->eCursorType = FXCT_VBEAM;
}
@@ -86,7 +85,7 @@
ecp.nBorderStyle = BorderStyle::SOLID;
ecp.rcRectWnd = CFX_FloatRect();
- auto pCaret = pdfium::MakeUnique<CPWL_Caret>(ecp, CloneAttachedData());
+ auto pCaret = std::make_unique<CPWL_Caret>(ecp, CloneAttachedData());
m_pEditCaret = pCaret.get();
m_pEditCaret->SetInvalidRect(GetClientRect());
AddChild(std::move(pCaret));
diff --git a/fpdfsdk/pwl/cpwl_edit_impl.cpp b/fpdfsdk/pwl/cpwl_edit_impl.cpp
index 8dbc9f1..3f9c04b 100644
--- a/fpdfsdk/pwl/cpwl_edit_impl.cpp
+++ b/fpdfsdk/pwl/cpwl_edit_impl.cpp
@@ -26,7 +26,6 @@
#include "fpdfsdk/pwl/cpwl_scroll_bar.h"
#include "fpdfsdk/pwl/ipwl_systemhandler.h"
#include "third_party/base/compiler_specific.h"
-#include "third_party/base/ptr_util.h"
namespace {
@@ -565,7 +564,7 @@
}
CPWL_EditImpl::CPWL_EditImpl()
- : m_pVT(pdfium::MakeUnique<CPDF_VariableText>()),
+ : m_pVT(std::make_unique<CPDF_VariableText>()),
m_bEnableScroll(false),
m_nAlignment(0),
m_bNotifyFlag(false),
@@ -582,7 +581,7 @@
}
void CPWL_EditImpl::SetFontMap(IPVT_FontMap* pFontMap) {
- m_pVTProvider = pdfium::MakeUnique<CPWL_EditImpl_Provider>(pFontMap);
+ m_pVTProvider = std::make_unique<CPWL_EditImpl_Provider>(pFontMap);
m_pVT->SetProvider(m_pVTProvider.get());
}
@@ -597,7 +596,7 @@
CPWL_EditImpl_Iterator* CPWL_EditImpl::GetIterator() {
if (!m_pIterator) {
m_pIterator =
- pdfium::MakeUnique<CPWL_EditImpl_Iterator>(this, m_pVT->GetIterator());
+ std::make_unique<CPWL_EditImpl_Iterator>(this, m_pVT->GetIterator());
}
return m_pIterator.get();
}
@@ -1538,7 +1537,7 @@
return false;
if (bAddUndo && m_bEnableUndo) {
- AddEditUndoItem(pdfium::MakeUnique<CFXEU_InsertWord>(
+ AddEditUndoItem(std::make_unique<CFXEU_InsertWord>(
this, m_wpOldCaret, m_wpCaret, word, charset));
}
if (bPaint)
@@ -1562,7 +1561,7 @@
if (bAddUndo && m_bEnableUndo) {
AddEditUndoItem(
- pdfium::MakeUnique<CFXEU_InsertReturn>(this, m_wpOldCaret, m_wpCaret));
+ std::make_unique<CFXEU_InsertReturn>(this, m_wpOldCaret, m_wpCaret));
}
if (bPaint) {
RearrangePart(CPVT_WordRange(m_wpOldCaret, m_wpCaret));
@@ -1594,7 +1593,7 @@
return false;
if (bAddUndo && m_bEnableUndo) {
- AddEditUndoItem(pdfium::MakeUnique<CFXEU_Backspace>(
+ AddEditUndoItem(std::make_unique<CFXEU_Backspace>(
this, m_wpOldCaret, m_wpCaret, word.Word, word.nCharset));
}
if (bPaint) {
@@ -1626,10 +1625,10 @@
m_SelState.Set(m_wpCaret, m_wpCaret);
if (bAddUndo && m_bEnableUndo) {
if (bSecEnd) {
- AddEditUndoItem(pdfium::MakeUnique<CFXEU_Delete>(
+ AddEditUndoItem(std::make_unique<CFXEU_Delete>(
this, m_wpOldCaret, m_wpCaret, word.Word, word.nCharset, bSecEnd));
} else {
- AddEditUndoItem(pdfium::MakeUnique<CFXEU_Delete>(
+ AddEditUndoItem(std::make_unique<CFXEU_Delete>(
this, m_wpOldCaret, m_wpCaret, word.Word, word.nCharset, bSecEnd));
}
}
@@ -1664,7 +1663,7 @@
CPVT_WordRange range = m_SelState.ConvertToWordRange();
if (bAddUndo && m_bEnableUndo) {
AddEditUndoItem(
- pdfium::MakeUnique<CFXEU_Clear>(this, range, GetSelectedText()));
+ std::make_unique<CFXEU_Clear>(this, range, GetSelectedText()));
}
SelectNone();
@@ -1697,7 +1696,7 @@
return false;
if (bAddUndo && m_bEnableUndo) {
- AddEditUndoItem(pdfium::MakeUnique<CFXEU_InsertText>(
+ AddEditUndoItem(std::make_unique<CFXEU_InsertText>(
this, m_wpOldCaret, m_wpCaret, sText, charset));
}
if (bPaint)
@@ -1721,10 +1720,10 @@
}
void CPWL_EditImpl::ReplaceSelection(const WideString& text) {
- AddEditUndoItem(pdfium::MakeUnique<CFXEU_ReplaceSelection>(this, false));
+ AddEditUndoItem(std::make_unique<CFXEU_ReplaceSelection>(this, false));
ClearSelection();
InsertText(text, FX_CHARSET_Default);
- AddEditUndoItem(pdfium::MakeUnique<CFXEU_ReplaceSelection>(this, true));
+ AddEditUndoItem(std::make_unique<CFXEU_ReplaceSelection>(this, true));
}
bool CPWL_EditImpl::Redo() {
diff --git a/fpdfsdk/pwl/cpwl_list_box.cpp b/fpdfsdk/pwl/cpwl_list_box.cpp
index 4ad9fe9..f00a0ad 100644
--- a/fpdfsdk/pwl/cpwl_list_box.cpp
+++ b/fpdfsdk/pwl/cpwl_list_box.cpp
@@ -17,7 +17,6 @@
#include "fpdfsdk/pwl/cpwl_scroll_bar.h"
#include "fpdfsdk/pwl/cpwl_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);
@@ -69,13 +68,13 @@
const CreateParams& cp,
std::unique_ptr<IPWL_SystemHandler::PerWindowData> pAttachedData)
: CPWL_Wnd(cp, std::move(pAttachedData)),
- m_pList(pdfium::MakeUnique<CPWL_ListCtrl>()) {}
+ m_pList(std::make_unique<CPWL_ListCtrl>()) {}
CPWL_ListBox::~CPWL_ListBox() = default;
void CPWL_ListBox::OnCreated() {
m_pList->SetFontMap(GetFontMap());
- m_pListNotify = pdfium::MakeUnique<CPWL_List_Notify>(this);
+ m_pListNotify = std::make_unique<CPWL_List_Notify>(this);
m_pList->SetNotify(m_pListNotify.get());
SetHoverSel(HasFlag(PLBS_HOVERSEL));
diff --git a/fpdfsdk/pwl/cpwl_list_impl.cpp b/fpdfsdk/pwl/cpwl_list_impl.cpp
index a7ceeb9..dd636ac 100644
--- a/fpdfsdk/pwl/cpwl_list_impl.cpp
+++ b/fpdfsdk/pwl/cpwl_list_impl.cpp
@@ -13,10 +13,9 @@
#include "core/fxcrt/fx_extension.h"
#include "fpdfsdk/pwl/cpwl_edit_impl.h"
#include "fpdfsdk/pwl/cpwl_list_box.h"
-#include "third_party/base/ptr_util.h"
#include "third_party/base/stl_util.h"
-CPWL_ListCtrl::Item::Item() : m_pEdit(pdfium::MakeUnique<CPWL_EditImpl>()) {
+CPWL_ListCtrl::Item::Item() : m_pEdit(std::make_unique<CPWL_EditImpl>()) {
m_pEdit->SetAlignmentV(1, true);
m_pEdit->Initialize();
}
@@ -561,7 +560,7 @@
}
void CPWL_ListCtrl::AddItem(const WideString& str) {
- auto pListItem = pdfium::MakeUnique<Item>();
+ auto pListItem = std::make_unique<Item>();
pListItem->SetFontMap(m_pFontMap.Get());
pListItem->SetFontSize(m_fFontSize);
pListItem->SetText(str);
diff --git a/fpdfsdk/pwl/cpwl_scroll_bar.cpp b/fpdfsdk/pwl/cpwl_scroll_bar.cpp
index 28de624..168f07b 100644
--- a/fpdfsdk/pwl/cpwl_scroll_bar.cpp
+++ b/fpdfsdk/pwl/cpwl_scroll_bar.cpp
@@ -15,7 +15,6 @@
#include "core/fxge/cfx_pathdata.h"
#include "core/fxge/cfx_renderdevice.h"
#include "fpdfsdk/pwl/cpwl_wnd.h"
-#include "third_party/base/ptr_util.h"
namespace {
@@ -539,24 +538,24 @@
PWS_VISIBLE | PWS_CHILD | PWS_BORDER | PWS_BACKGROUND | PWS_NOREFRESHCLIP;
if (!m_pMinButton) {
- auto pButton = pdfium::MakeUnique<CPWL_SBButton>(scp, CloneAttachedData(),
- m_sbType, PSBT_MIN);
+ auto pButton = std::make_unique<CPWL_SBButton>(scp, CloneAttachedData(),
+ m_sbType, PSBT_MIN);
m_pMinButton = pButton.get();
AddChild(std::move(pButton));
m_pMinButton->Realize();
}
if (!m_pMaxButton) {
- auto pButton = pdfium::MakeUnique<CPWL_SBButton>(scp, CloneAttachedData(),
- m_sbType, PSBT_MAX);
+ auto pButton = std::make_unique<CPWL_SBButton>(scp, CloneAttachedData(),
+ m_sbType, PSBT_MAX);
m_pMaxButton = pButton.get();
AddChild(std::move(pButton));
m_pMaxButton->Realize();
}
if (!m_pPosButton) {
- auto pButton = pdfium::MakeUnique<CPWL_SBButton>(scp, CloneAttachedData(),
- m_sbType, PSBT_POS);
+ auto pButton = std::make_unique<CPWL_SBButton>(scp, CloneAttachedData(),
+ m_sbType, PSBT_POS);
m_pPosButton = pButton.get();
ObservedPtr<CPWL_ScrollBar> thisObserved(this);
if (m_pPosButton->SetVisible(false) && thisObserved) {
@@ -677,7 +676,7 @@
NotifyScrollWindow();
m_bMinOrMax = true;
- m_pTimer = pdfium::MakeUnique<CFX_Timer>(GetTimerHandler(), this, 100);
+ m_pTimer = std::make_unique<CFX_Timer>(GetTimerHandler(), this, 100);
}
void CPWL_ScrollBar::OnMinButtonLBUp(const CFX_PointF& point) {}
@@ -691,7 +690,7 @@
NotifyScrollWindow();
m_bMinOrMax = false;
- m_pTimer = pdfium::MakeUnique<CFX_Timer>(GetTimerHandler(), this, 100);
+ m_pTimer = std::make_unique<CFX_Timer>(GetTimerHandler(), this, 100);
}
void CPWL_ScrollBar::OnMaxButtonLBUp(const CFX_PointF& point) {}
diff --git a/fpdfsdk/pwl/cpwl_wnd.cpp b/fpdfsdk/pwl/cpwl_wnd.cpp
index c230ff5..1b808dd 100644
--- a/fpdfsdk/pwl/cpwl_wnd.cpp
+++ b/fpdfsdk/pwl/cpwl_wnd.cpp
@@ -14,7 +14,6 @@
#include "core/fxge/cfx_renderdevice.h"
#include "fpdfsdk/pwl/cpwl_scroll_bar.h"
#include "public/fpdf_fwlevent.h"
-#include "third_party/base/ptr_util.h"
#include "third_party/base/stl_util.h"
namespace {
@@ -490,7 +489,7 @@
scp.nTransparency = PWL_SCROLLBAR_TRANSPARENCY;
auto pBar =
- pdfium::MakeUnique<CPWL_ScrollBar>(scp, CloneAttachedData(), SBT_VSCROLL);
+ std::make_unique<CPWL_ScrollBar>(scp, CloneAttachedData(), SBT_VSCROLL);
m_pVScrollBar = pBar.get();
AddChild(std::move(pBar));
m_pVScrollBar->Realize();