Convert remaining pdfium::MakeUnique<> to std::make_unique<> in xfa
Change-Id: I662af52969f5223e8dcf8d6b3a2b13498382a40c
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/69995
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
diff --git a/xfa/fde/cfde_texteditengine.cpp b/xfa/fde/cfde_texteditengine.cpp
index 957b6ff..ec56454 100644
--- a/xfa/fde/cfde_texteditengine.cpp
+++ b/xfa/fde/cfde_texteditengine.cpp
@@ -11,7 +11,6 @@
#include <utility>
#include "core/fxge/text_char_pos.h"
-#include "third_party/base/ptr_util.h"
#include "xfa/fde/cfde_textout.h"
#include "xfa/fde/cfde_wordbreak_data.h"
#include "xfa/fgas/font/cfgas_gefont.h"
@@ -209,7 +208,7 @@
if (!limit_horizontal_area_ && !limit_vertical_area_)
return 0;
- auto text_out = pdfium::MakeUnique<CFDE_TextOut>();
+ auto text_out = std::make_unique<CFDE_TextOut>();
text_out->SetLineSpace(line_spacing_);
text_out->SetFont(font_);
text_out->SetFontSize(font_size_);
@@ -344,7 +343,7 @@
if (add_operation == RecordOperation::kInsertRecord) {
AddOperationRecord(
- pdfium::MakeUnique<InsertOperation>(this, gap_position_, text));
+ std::make_unique<InsertOperation>(this, gap_position_, text));
}
WideString previous_text;
@@ -855,8 +854,7 @@
ret += WideStringView(content_.data() + start_idx, length);
if (add_operation == RecordOperation::kInsertRecord) {
- AddOperationRecord(
- pdfium::MakeUnique<DeleteOperation>(this, start_idx, ret));
+ AddOperationRecord(std::make_unique<DeleteOperation>(this, start_idx, ret));
}
WideString previous_text = GetText();
@@ -903,7 +901,7 @@
Insert(gap_position_, rep, RecordOperation::kSkipRecord);
AddOperationRecord(
- pdfium::MakeUnique<ReplaceOperation>(this, start_idx, txt, rep));
+ std::make_unique<ReplaceOperation>(this, start_idx, txt, rep));
}
WideString CFDE_TextEditEngine::GetText() const {
@@ -1086,7 +1084,7 @@
size_t current_piece_start = 0;
float current_line_start = 0;
- auto iter = pdfium::MakeUnique<CFDE_TextEditEngine::Iterator>(this);
+ auto iter = std::make_unique<CFDE_TextEditEngine::Iterator>(this);
while (!iter->IsEOF(false)) {
iter->Next(false);
diff --git a/xfa/fde/cfde_texteditengine_unittest.cpp b/xfa/fde/cfde_texteditengine_unittest.cpp
index 2089dff..cef7628 100644
--- a/xfa/fde/cfde_texteditengine_unittest.cpp
+++ b/xfa/fde/cfde_texteditengine_unittest.cpp
@@ -7,7 +7,6 @@
#include "core/fxge/text_char_pos.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "testing/xfa_unit_test_support.h"
-#include "third_party/base/ptr_util.h"
#include "xfa/fgas/font/cfgas_gefont.h"
class CFDE_TextEditEngineTest : public testing::Test {
@@ -42,7 +41,7 @@
CFGAS_GEFont::LoadFont(L"Arial Black", 0, 0, GetGlobalFontManager());
ASSERT_TRUE(font_.Get() != nullptr);
- engine_ = pdfium::MakeUnique<CFDE_TextEditEngine>();
+ engine_ = std::make_unique<CFDE_TextEditEngine>();
engine_->SetFont(font_);
engine_->SetFontSize(12.0f);
}
@@ -94,7 +93,7 @@
engine()->Clear();
// With Delegate
- auto delegate = pdfium::MakeUnique<CFDE_TextEditEngineTest::Delegate>();
+ auto delegate = std::make_unique<CFDE_TextEditEngineTest::Delegate>();
engine()->SetDelegate(delegate.get());
engine()->SetCharacterLimit(5);
diff --git a/xfa/fde/cfde_textout.cpp b/xfa/fde/cfde_textout.cpp
index cd419bd..e26a63f 100644
--- a/xfa/fde/cfde_textout.cpp
+++ b/xfa/fde/cfde_textout.cpp
@@ -18,7 +18,6 @@
#include "core/fxge/cfx_substfont.h"
#include "core/fxge/fx_font.h"
#include "core/fxge/text_char_pos.h"
-#include "third_party/base/ptr_util.h"
#include "third_party/base/stl_util.h"
#include "xfa/fgas/font/cfgas_gefont.h"
#include "xfa/fgas/layout/cfx_txtbreak.h"
@@ -59,7 +58,7 @@
#if !defined(OS_WIN)
uint32_t dwFontStyle = pFont->GetFontStyles();
CFX_Font FxFont;
- auto SubstFxFont = pdfium::MakeUnique<CFX_SubstFont>();
+ auto SubstFxFont = std::make_unique<CFX_SubstFont>();
SubstFxFont->m_Weight = FontStyleIsForceBold(dwFontStyle) ? 700 : 400;
SubstFxFont->m_ItalicAngle = FontStyleIsItalic(dwFontStyle) ? -12 : 0;
SubstFxFont->m_WeightCJK = SubstFxFont->m_Weight;
@@ -128,7 +127,7 @@
FDE_TTOPIECE::~FDE_TTOPIECE() = default;
CFDE_TextOut::CFDE_TextOut()
- : m_pTxtBreak(pdfium::MakeUnique<CFX_TxtBreak>()), m_ttoLines(5) {}
+ : m_pTxtBreak(std::make_unique<CFX_TxtBreak>()), m_ttoLines(5) {}
CFDE_TextOut::~CFDE_TextOut() = default;
diff --git a/xfa/fgas/crt/cfgas_stringformatter_unittest.cpp b/xfa/fgas/crt/cfgas_stringformatter_unittest.cpp
index fc8d485..6c5ec97 100644
--- a/xfa/fgas/crt/cfgas_stringformatter_unittest.cpp
+++ b/xfa/fgas/crt/cfgas_stringformatter_unittest.cpp
@@ -14,7 +14,6 @@
#include "core/fpdfapi/page/cpdf_pagemodule.h"
#include "testing/fx_string_testhelpers.h"
#include "testing/gtest/include/gtest/gtest.h"
-#include "third_party/base/ptr_util.h"
#include "third_party/base/stl_util.h"
#include "xfa/fxfa/parser/cxfa_localemgr.h"
@@ -47,8 +46,8 @@
CFGAS_StringFormatter* fmt(const WideString& locale,
const WideString& pattern) {
fmt_.reset(); // Can't outlive |mgr_|.
- mgr_ = pdfium::MakeUnique<CXFA_LocaleMgr>(nullptr, locale);
- fmt_ = pdfium::MakeUnique<CFGAS_StringFormatter>(mgr_.get(), pattern);
+ mgr_ = std::make_unique<CXFA_LocaleMgr>(nullptr, locale);
+ fmt_ = std::make_unique<CFGAS_StringFormatter>(mgr_.get(), pattern);
return fmt_.get();
}
diff --git a/xfa/fgas/font/cfgas_fontmgr.cpp b/xfa/fgas/font/cfgas_fontmgr.cpp
index a303525..d0da901 100644
--- a/xfa/fgas/font/cfgas_fontmgr.cpp
+++ b/xfa/fgas/font/cfgas_fontmgr.cpp
@@ -19,7 +19,6 @@
#include "core/fxge/cfx_fontmgr.h"
#include "core/fxge/cfx_gemodule.h"
#include "core/fxge/fx_font.h"
-#include "third_party/base/ptr_util.h"
#include "third_party/base/stl_util.h"
#include "xfa/fgas/font/cfgas_gefont.h"
#include "xfa/fgas/font/fgas_fontutils.h"
@@ -611,7 +610,7 @@
CFX_FontDescriptor::~CFX_FontDescriptor() {}
CFGAS_FontMgr::CFGAS_FontMgr()
- : m_pFontSource(pdfium::MakeUnique<CFX_FontSourceEnum_File>()) {}
+ : m_pFontSource(std::make_unique<CFX_FontSourceEnum_File>()) {}
CFGAS_FontMgr::~CFGAS_FontMgr() {}
@@ -659,7 +658,7 @@
std::vector<CFX_FontDescriptorInfo>* sortedFontInfos =
m_Hash2CandidateList[dwHash].get();
if (!sortedFontInfos) {
- auto pNewFonts = pdfium::MakeUnique<std::vector<CFX_FontDescriptorInfo>>();
+ auto pNewFonts = std::make_unique<std::vector<CFX_FontDescriptorInfo>>();
sortedFontInfos = pNewFonts.get();
MatchFonts(sortedFontInfos, wCodePage, dwFontStyles,
WideString(pszFontFamily), wUnicode);
@@ -690,7 +689,7 @@
if (!pFontStream)
return nullptr;
- auto pInternalFont = pdfium::MakeUnique<CFX_Font>();
+ auto pInternalFont = std::make_unique<CFX_Font>();
if (!pInternalFont->LoadFile(pFontStream, iFaceIndex))
return nullptr;
@@ -727,7 +726,7 @@
if ((pFace->GetRec()->face_flags & FT_FACE_FLAG_SCALABLE) == 0)
return;
- auto pFont = pdfium::MakeUnique<CFX_FontDescriptor>();
+ auto pFont = std::make_unique<CFX_FontDescriptor>();
pFont->m_dwFontStyles |= GetFlags(pFace->GetRec());
GetUSBCSB(pFace->GetRec(), pFont->m_dwUsb, pFont->m_dwCsb);
@@ -807,7 +806,7 @@
std::vector<CFX_FontDescriptorInfo>* sortedFontInfos =
m_Hash2CandidateList[dwHash].get();
if (!sortedFontInfos) {
- auto pNewFonts = pdfium::MakeUnique<std::vector<CFX_FontDescriptorInfo>>();
+ auto pNewFonts = std::make_unique<std::vector<CFX_FontDescriptorInfo>>();
sortedFontInfos = pNewFonts.get();
MatchFonts(sortedFontInfos, wCodePage, dwFontStyles,
WideString(pszFontFamily), 0);
diff --git a/xfa/fgas/font/cfgas_gefont.cpp b/xfa/fgas/font/cfgas_gefont.cpp
index 5a7c625..5719662 100644
--- a/xfa/fgas/font/cfgas_gefont.cpp
+++ b/xfa/fgas/font/cfgas_gefont.cpp
@@ -16,7 +16,6 @@
#include "core/fxge/cfx_substfont.h"
#include "core/fxge/cfx_unicodeencodingex.h"
#include "core/fxge/fx_font.h"
-#include "third_party/base/ptr_util.h"
#include "xfa/fgas/font/fgas_fontutils.h"
// static
@@ -83,7 +82,7 @@
int32_t iWeight =
FontStyleIsForceBold(dwFontStyles) ? FXFONT_FW_BOLD : FXFONT_FW_NORMAL;
- m_pFont = pdfium::MakeUnique<CFX_Font>();
+ m_pFont = std::make_unique<CFX_Font>();
if (FontStyleIsItalic(dwFontStyles) && FontStyleIsForceBold(dwFontStyles))
csFontFamily += ",BoldItalic";
else if (FontStyleIsForceBold(dwFontStyles))
diff --git a/xfa/fgas/layout/cfx_rtfbreak_unittest.cpp b/xfa/fgas/layout/cfx_rtfbreak_unittest.cpp
index 0775d7b..d198a6c 100644
--- a/xfa/fgas/layout/cfx_rtfbreak_unittest.cpp
+++ b/xfa/fgas/layout/cfx_rtfbreak_unittest.cpp
@@ -13,7 +13,6 @@
#include "core/fxge/cfx_gemodule.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "testing/xfa_unit_test_support.h"
-#include "third_party/base/ptr_util.h"
#include "xfa/fgas/font/cfgas_fontmgr.h"
#include "xfa/fgas/font/cfgas_gefont.h"
#include "xfa/fgas/layout/cfx_char.h"
@@ -27,7 +26,7 @@
}
std::unique_ptr<CFX_RTFBreak> CreateBreak(uint32_t layout_styles) {
- auto rtf_break = pdfium::MakeUnique<CFX_RTFBreak>(layout_styles);
+ auto rtf_break = std::make_unique<CFX_RTFBreak>(layout_styles);
rtf_break->SetFont(font_);
return rtf_break;
}
diff --git a/xfa/fgas/layout/cfx_txtbreak_unittest.cpp b/xfa/fgas/layout/cfx_txtbreak_unittest.cpp
index a3ae207..9825a32 100644
--- a/xfa/fgas/layout/cfx_txtbreak_unittest.cpp
+++ b/xfa/fgas/layout/cfx_txtbreak_unittest.cpp
@@ -10,7 +10,6 @@
#include "core/fxge/cfx_font.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "testing/xfa_unit_test_support.h"
-#include "third_party/base/ptr_util.h"
#include "xfa/fgas/font/cfgas_fontmgr.h"
#include "xfa/fgas/font/cfgas_gefont.h"
#include "xfa/fgas/layout/cfx_char.h"
@@ -24,7 +23,7 @@
}
std::unique_ptr<CFX_TxtBreak> CreateBreak() {
- auto txt_break = pdfium::MakeUnique<CFX_TxtBreak>();
+ auto txt_break = std::make_unique<CFX_TxtBreak>();
txt_break->SetFont(font_);
return txt_break;
}
diff --git a/xfa/fwl/cfwl_app.cpp b/xfa/fwl/cfwl_app.cpp
index c3a06e3..4e5b593 100644
--- a/xfa/fwl/cfwl_app.cpp
+++ b/xfa/fwl/cfwl_app.cpp
@@ -6,7 +6,6 @@
#include "xfa/fwl/cfwl_app.h"
-#include "third_party/base/ptr_util.h"
#include "xfa/fwl/cfwl_notedriver.h"
#include "xfa/fwl/cfwl_widget.h"
#include "xfa/fwl/cfwl_widgetmgr.h"
@@ -14,8 +13,8 @@
CFWL_App::CFWL_App(AdapterIface* pAdapter)
: m_pAdapterNative(pAdapter),
m_pWidgetMgr(
- pdfium::MakeUnique<CFWL_WidgetMgr>(pAdapter->GetWidgetMgrAdapter())),
- m_pNoteDriver(pdfium::MakeUnique<CFWL_NoteDriver>()) {
+ std::make_unique<CFWL_WidgetMgr>(pAdapter->GetWidgetMgrAdapter())),
+ m_pNoteDriver(std::make_unique<CFWL_NoteDriver>()) {
ASSERT(m_pAdapterNative);
}
diff --git a/xfa/fwl/cfwl_barcode.cpp b/xfa/fwl/cfwl_barcode.cpp
index 008424d..b6833bf 100644
--- a/xfa/fwl/cfwl_barcode.cpp
+++ b/xfa/fwl/cfwl_barcode.cpp
@@ -9,7 +9,6 @@
#include <utility>
#include "fxbarcode/cfx_barcode.h"
-#include "third_party/base/ptr_util.h"
#include "xfa/fgas/font/cfgas_gefont.h"
#include "xfa/fwl/cfwl_notedriver.h"
#include "xfa/fwl/cfwl_themepart.h"
@@ -17,7 +16,7 @@
#include "xfa/fwl/theme/cfwl_utils.h"
CFWL_Barcode::CFWL_Barcode(const CFWL_App* app)
- : CFWL_Edit(app, pdfium::MakeUnique<CFWL_WidgetProperties>(), nullptr) {}
+ : CFWL_Edit(app, std::make_unique<CFWL_WidgetProperties>(), nullptr) {}
CFWL_Barcode::~CFWL_Barcode() = default;
diff --git a/xfa/fwl/cfwl_caret.cpp b/xfa/fwl/cfwl_caret.cpp
index 437ce4a..d17fc21 100644
--- a/xfa/fwl/cfwl_caret.cpp
+++ b/xfa/fwl/cfwl_caret.cpp
@@ -8,7 +8,6 @@
#include <utility>
-#include "third_party/base/ptr_util.h"
#include "xfa/fwl/cfwl_app.h"
#include "xfa/fwl/cfwl_notedriver.h"
#include "xfa/fwl/cfwl_themebackground.h"
@@ -51,7 +50,7 @@
}
void CFWL_Caret::ShowCaret() {
- m_pTimer = pdfium::MakeUnique<CFX_Timer>(
+ m_pTimer = std::make_unique<CFX_Timer>(
GetOwnerApp()->GetAdapterNative()->GetTimerHandler(), this,
kBlinkPeriodMs);
RemoveStates(FWL_WGTSTATE_Invisible);
diff --git a/xfa/fwl/cfwl_checkbox.cpp b/xfa/fwl/cfwl_checkbox.cpp
index 09cf136..abba486 100644
--- a/xfa/fwl/cfwl_checkbox.cpp
+++ b/xfa/fwl/cfwl_checkbox.cpp
@@ -11,7 +11,6 @@
#include <utility>
#include <vector>
-#include "third_party/base/ptr_util.h"
#include "xfa/fde/cfde_textout.h"
#include "xfa/fwl/cfwl_app.h"
#include "xfa/fwl/cfwl_event.h"
@@ -31,7 +30,7 @@
} // namespace
CFWL_CheckBox::CFWL_CheckBox(const CFWL_App* app)
- : CFWL_Widget(app, pdfium::MakeUnique<CFWL_WidgetProperties>(), nullptr) {
+ : CFWL_Widget(app, std::make_unique<CFWL_WidgetProperties>(), nullptr) {
m_TTOStyles.single_line_ = true;
}
diff --git a/xfa/fwl/cfwl_combobox.cpp b/xfa/fwl/cfwl_combobox.cpp
index 34bdf08..4e12e0c 100644
--- a/xfa/fwl/cfwl_combobox.cpp
+++ b/xfa/fwl/cfwl_combobox.cpp
@@ -10,7 +10,6 @@
#include <memory>
#include <utility>
-#include "third_party/base/ptr_util.h"
#include "xfa/fde/cfde_texteditengine.h"
#include "xfa/fde/cfde_textout.h"
#include "xfa/fwl/cfwl_app.h"
@@ -30,7 +29,7 @@
#include "xfa/fwl/ifwl_themeprovider.h"
CFWL_ComboBox::CFWL_ComboBox(const CFWL_App* app)
- : CFWL_Widget(app, pdfium::MakeUnique<CFWL_WidgetProperties>(), nullptr) {
+ : CFWL_Widget(app, std::make_unique<CFWL_WidgetProperties>(), nullptr) {
InitComboList();
InitComboEdit();
}
@@ -405,25 +404,25 @@
if (m_pListBox)
return;
- auto prop = pdfium::MakeUnique<CFWL_WidgetProperties>();
+ auto prop = std::make_unique<CFWL_WidgetProperties>();
prop->m_pParent = this;
prop->m_dwStyles = FWL_WGTSTYLE_Border | FWL_WGTSTYLE_VScroll;
prop->m_dwStates = FWL_WGTSTATE_Invisible;
prop->m_pThemeProvider = m_pProperties->m_pThemeProvider;
- m_pListBox = pdfium::MakeUnique<CFWL_ComboList>(m_pOwnerApp.Get(),
- std::move(prop), this);
+ m_pListBox = std::make_unique<CFWL_ComboList>(m_pOwnerApp.Get(),
+ std::move(prop), this);
}
void CFWL_ComboBox::InitComboEdit() {
if (m_pEdit)
return;
- auto prop = pdfium::MakeUnique<CFWL_WidgetProperties>();
+ auto prop = std::make_unique<CFWL_WidgetProperties>();
prop->m_pParent = this;
prop->m_pThemeProvider = m_pProperties->m_pThemeProvider;
- m_pEdit = pdfium::MakeUnique<CFWL_ComboEdit>(m_pOwnerApp.Get(),
- std::move(prop), this);
+ m_pEdit = std::make_unique<CFWL_ComboEdit>(m_pOwnerApp.Get(), std::move(prop),
+ this);
m_pEdit->SetOuter(this);
}
diff --git a/xfa/fwl/cfwl_datetimepicker.cpp b/xfa/fwl/cfwl_datetimepicker.cpp
index 48d857b..4721197 100644
--- a/xfa/fwl/cfwl_datetimepicker.cpp
+++ b/xfa/fwl/cfwl_datetimepicker.cpp
@@ -9,7 +9,6 @@
#include <memory>
#include <utility>
-#include "third_party/base/ptr_util.h"
#include "xfa/fwl/cfwl_event.h"
#include "xfa/fwl/cfwl_eventselectchanged.h"
#include "xfa/fwl/cfwl_messagemouse.h"
@@ -25,26 +24,26 @@
} // namespace
CFWL_DateTimePicker::CFWL_DateTimePicker(const CFWL_App* app)
- : CFWL_Widget(app, pdfium::MakeUnique<CFWL_WidgetProperties>(), nullptr) {
+ : CFWL_Widget(app, std::make_unique<CFWL_WidgetProperties>(), nullptr) {
m_pProperties->m_dwStyleExes = FWL_STYLEEXT_DTP_ShortDateFormat;
- auto monthProp = pdfium::MakeUnique<CFWL_WidgetProperties>();
+ auto monthProp = std::make_unique<CFWL_WidgetProperties>();
monthProp->m_dwStyles = FWL_WGTSTYLE_Popup | FWL_WGTSTYLE_Border;
monthProp->m_dwStates = FWL_WGTSTATE_Invisible;
monthProp->m_pParent = this;
monthProp->m_pThemeProvider = m_pProperties->m_pThemeProvider;
- m_pMonthCal = pdfium::MakeUnique<CFWL_MonthCalendar>(
+ m_pMonthCal = std::make_unique<CFWL_MonthCalendar>(
m_pOwnerApp.Get(), std::move(monthProp), this);
m_pMonthCal->SetWidgetRect(
CFX_RectF(0, 0, m_pMonthCal->GetAutosizedWidgetRect().Size()));
- auto editProp = pdfium::MakeUnique<CFWL_WidgetProperties>();
+ auto editProp = std::make_unique<CFWL_WidgetProperties>();
editProp->m_pParent = this;
editProp->m_pThemeProvider = m_pProperties->m_pThemeProvider;
- m_pEdit = pdfium::MakeUnique<CFWL_DateTimeEdit>(m_pOwnerApp.Get(),
- std::move(editProp), this);
+ m_pEdit = std::make_unique<CFWL_DateTimeEdit>(m_pOwnerApp.Get(),
+ std::move(editProp), this);
RegisterEventTarget(m_pMonthCal.get());
RegisterEventTarget(m_pEdit.get());
}
diff --git a/xfa/fwl/cfwl_edit.cpp b/xfa/fwl/cfwl_edit.cpp
index ec3b699..4abe00c 100644
--- a/xfa/fwl/cfwl_edit.cpp
+++ b/xfa/fwl/cfwl_edit.cpp
@@ -14,7 +14,6 @@
#include "build/build_config.h"
#include "core/fxge/cfx_renderdevice.h"
#include "core/fxge/text_char_pos.h"
-#include "third_party/base/ptr_util.h"
#include "third_party/base/stl_util.h"
#include "xfa/fde/cfde_textout.h"
#include "xfa/fgas/font/cfgas_gefont.h"
@@ -49,7 +48,7 @@
std::unique_ptr<CFWL_WidgetProperties> properties,
CFWL_Widget* pOuter)
: CFWL_Widget(app, std::move(properties), pOuter),
- m_pEditEngine(pdfium::MakeUnique<CFDE_TextEditEngine>()) {
+ m_pEditEngine(std::make_unique<CFDE_TextEditEngine>()) {
m_pEditEngine->SetDelegate(this);
}
@@ -875,26 +874,26 @@
if (m_pVertScrollBar)
return;
- auto prop = pdfium::MakeUnique<CFWL_WidgetProperties>();
+ auto prop = std::make_unique<CFWL_WidgetProperties>();
prop->m_dwStyleExes = FWL_STYLEEXT_SCB_Vert;
prop->m_dwStates = FWL_WGTSTATE_Disabled | FWL_WGTSTATE_Invisible;
prop->m_pParent = this;
prop->m_pThemeProvider = m_pProperties->m_pThemeProvider;
- m_pVertScrollBar = pdfium::MakeUnique<CFWL_ScrollBar>(m_pOwnerApp.Get(),
- std::move(prop), this);
+ m_pVertScrollBar = std::make_unique<CFWL_ScrollBar>(m_pOwnerApp.Get(),
+ std::move(prop), this);
}
void CFWL_Edit::InitHorizontalScrollBar() {
if (m_pHorzScrollBar)
return;
- auto prop = pdfium::MakeUnique<CFWL_WidgetProperties>();
+ auto prop = std::make_unique<CFWL_WidgetProperties>();
prop->m_dwStyleExes = FWL_STYLEEXT_SCB_Horz;
prop->m_dwStates = FWL_WGTSTATE_Disabled | FWL_WGTSTATE_Invisible;
prop->m_pParent = this;
prop->m_pThemeProvider = m_pProperties->m_pThemeProvider;
- m_pHorzScrollBar = pdfium::MakeUnique<CFWL_ScrollBar>(m_pOwnerApp.Get(),
- std::move(prop), this);
+ m_pHorzScrollBar = std::make_unique<CFWL_ScrollBar>(m_pOwnerApp.Get(),
+ std::move(prop), this);
}
void CFWL_Edit::ShowCaret(CFX_RectF* pRect) {
@@ -966,8 +965,8 @@
if (m_pCaret)
return;
- m_pCaret = pdfium::MakeUnique<CFWL_Caret>(
- m_pOwnerApp.Get(), pdfium::MakeUnique<CFWL_WidgetProperties>(), this);
+ m_pCaret = std::make_unique<CFWL_Caret>(
+ m_pOwnerApp.Get(), std::make_unique<CFWL_WidgetProperties>(), this);
m_pCaret->SetParent(this);
m_pCaret->SetStates(m_pProperties->m_dwStates);
UpdateCursorRect();
diff --git a/xfa/fwl/cfwl_listbox.cpp b/xfa/fwl/cfwl_listbox.cpp
index 4ff3d5e..af28a40 100644
--- a/xfa/fwl/cfwl_listbox.cpp
+++ b/xfa/fwl/cfwl_listbox.cpp
@@ -10,7 +10,6 @@
#include <memory>
#include <utility>
-#include "third_party/base/ptr_util.h"
#include "third_party/base/stl_util.h"
#include "xfa/fde/cfde_textout.h"
#include "xfa/fwl/cfwl_app.h"
@@ -616,26 +615,26 @@
if (m_pVertScrollBar)
return;
- auto prop = pdfium::MakeUnique<CFWL_WidgetProperties>();
+ auto prop = std::make_unique<CFWL_WidgetProperties>();
prop->m_dwStyleExes = FWL_STYLEEXT_SCB_Vert;
prop->m_dwStates = FWL_WGTSTATE_Invisible;
prop->m_pParent = this;
prop->m_pThemeProvider = m_pScrollBarTP;
- m_pVertScrollBar = pdfium::MakeUnique<CFWL_ScrollBar>(m_pOwnerApp.Get(),
- std::move(prop), this);
+ m_pVertScrollBar = std::make_unique<CFWL_ScrollBar>(m_pOwnerApp.Get(),
+ std::move(prop), this);
}
void CFWL_ListBox::InitHorizontalScrollBar() {
if (m_pHorzScrollBar)
return;
- auto prop = pdfium::MakeUnique<CFWL_WidgetProperties>();
+ auto prop = std::make_unique<CFWL_WidgetProperties>();
prop->m_dwStyleExes = FWL_STYLEEXT_SCB_Horz;
prop->m_dwStates = FWL_WGTSTATE_Invisible;
prop->m_pParent = this;
prop->m_pThemeProvider = m_pScrollBarTP;
- m_pHorzScrollBar = pdfium::MakeUnique<CFWL_ScrollBar>(m_pOwnerApp.Get(),
- std::move(prop), this);
+ m_pHorzScrollBar = std::make_unique<CFWL_ScrollBar>(m_pOwnerApp.Get(),
+ std::move(prop), this);
}
bool CFWL_ListBox::IsShowScrollBar(bool bVert) {
@@ -903,7 +902,7 @@
}
CFWL_ListItem* CFWL_ListBox::AddString(const WideString& wsAdd) {
- m_ItemArray.emplace_back(pdfium::MakeUnique<CFWL_ListItem>(wsAdd));
+ m_ItemArray.emplace_back(std::make_unique<CFWL_ListItem>(wsAdd));
return m_ItemArray.back().get();
}
diff --git a/xfa/fwl/cfwl_monthcalendar.cpp b/xfa/fwl/cfwl_monthcalendar.cpp
index ac03308..b1ca9b7 100644
--- a/xfa/fwl/cfwl_monthcalendar.cpp
+++ b/xfa/fwl/cfwl_monthcalendar.cpp
@@ -10,7 +10,6 @@
#include <memory>
#include <utility>
-#include "third_party/base/ptr_util.h"
#include "third_party/base/stl_util.h"
#include "xfa/fde/cfde_textout.h"
#include "xfa/fwl/cfwl_datetimepicker.h"
@@ -556,7 +555,7 @@
dwStates |= FWL_ITEMSTATE_MCD_Selected;
CFX_RectF rtDate;
- m_DateArray.push_back(pdfium::MakeUnique<DATEINFO>(
+ m_DateArray.push_back(std::make_unique<DATEINFO>(
i + 1, iDayOfWeek, dwStates, rtDate, WideString::Format(L"%d", i + 1)));
iDayOfWeek++;
}
diff --git a/xfa/fwl/cfwl_notedriver.cpp b/xfa/fwl/cfwl_notedriver.cpp
index 63ccce3..21fe0f5 100644
--- a/xfa/fwl/cfwl_notedriver.cpp
+++ b/xfa/fwl/cfwl_notedriver.cpp
@@ -11,7 +11,6 @@
#include "build/build_config.h"
#include "core/fxcrt/fx_extension.h"
-#include "third_party/base/ptr_util.h"
#include "third_party/base/stl_util.h"
#include "xfa/fwl/cfwl_app.h"
#include "xfa/fwl/cfwl_eventtarget.h"
@@ -44,7 +43,7 @@
pListener->SetEventKey(key);
}
if (!m_eventTargets[key])
- m_eventTargets[key] = pdfium::MakeUnique<CFWL_EventTarget>(pListener);
+ m_eventTargets[key] = std::make_unique<CFWL_EventTarget>(pListener);
m_eventTargets[key]->SetEventSource(pEventSource);
}
diff --git a/xfa/fwl/cfwl_picturebox.cpp b/xfa/fwl/cfwl_picturebox.cpp
index 287195c..7b9fe11 100644
--- a/xfa/fwl/cfwl_picturebox.cpp
+++ b/xfa/fwl/cfwl_picturebox.cpp
@@ -8,11 +8,8 @@
#include <memory>
-#include "third_party/base/ptr_util.h"
-
CFWL_PictureBox::CFWL_PictureBox(const CFWL_App* app)
- : CFWL_Widget(app, pdfium::MakeUnique<CFWL_WidgetProperties>(), nullptr) {
-}
+ : CFWL_Widget(app, std::make_unique<CFWL_WidgetProperties>(), nullptr) {}
CFWL_PictureBox::~CFWL_PictureBox() {}
diff --git a/xfa/fwl/cfwl_pushbutton.cpp b/xfa/fwl/cfwl_pushbutton.cpp
index 2cde79c..4d40baa 100644
--- a/xfa/fwl/cfwl_pushbutton.cpp
+++ b/xfa/fwl/cfwl_pushbutton.cpp
@@ -9,7 +9,6 @@
#include <memory>
#include <utility>
-#include "third_party/base/ptr_util.h"
#include "xfa/fde/cfde_textout.h"
#include "xfa/fwl/cfwl_event.h"
#include "xfa/fwl/cfwl_eventmouse.h"
@@ -22,7 +21,7 @@
#include "xfa/fwl/ifwl_themeprovider.h"
CFWL_PushButton::CFWL_PushButton(const CFWL_App* app)
- : CFWL_Widget(app, pdfium::MakeUnique<CFWL_WidgetProperties>(), nullptr) {}
+ : CFWL_Widget(app, std::make_unique<CFWL_WidgetProperties>(), nullptr) {}
CFWL_PushButton::~CFWL_PushButton() {}
diff --git a/xfa/fwl/cfwl_scrollbar.cpp b/xfa/fwl/cfwl_scrollbar.cpp
index e022e85..a2f9aa7 100644
--- a/xfa/fwl/cfwl_scrollbar.cpp
+++ b/xfa/fwl/cfwl_scrollbar.cpp
@@ -10,7 +10,6 @@
#include <memory>
#include <utility>
-#include "third_party/base/ptr_util.h"
#include "third_party/base/stl_util.h"
#include "xfa/fwl/cfwl_app.h"
#include "xfa/fwl/cfwl_messagemouse.h"
@@ -356,7 +355,7 @@
DoMouseDown(4, m_MaxTrackRect, m_iMaxTrackState, point);
if (!SendEvent()) {
- m_pTimer = pdfium::MakeUnique<CFX_Timer>(
+ m_pTimer = std::make_unique<CFX_Timer>(
GetOwnerApp()->GetAdapterNative()->GetTimerHandler(), this,
FWL_SCROLLBAR_Elapse);
}
@@ -463,7 +462,7 @@
void CFWL_ScrollBar::OnTimerFired() {
m_pTimer.reset();
if (!SendEvent()) {
- m_pTimer = pdfium::MakeUnique<CFX_Timer>(
+ m_pTimer = std::make_unique<CFX_Timer>(
GetOwnerApp()->GetAdapterNative()->GetTimerHandler(), this, 0);
}
}
diff --git a/xfa/fwl/cfwl_widgetmgr.cpp b/xfa/fwl/cfwl_widgetmgr.cpp
index cb41430..b2e61b9 100644
--- a/xfa/fwl/cfwl_widgetmgr.cpp
+++ b/xfa/fwl/cfwl_widgetmgr.cpp
@@ -9,14 +9,13 @@
#include <utility>
#include "build/build_config.h"
-#include "third_party/base/ptr_util.h"
#include "xfa/fwl/cfwl_app.h"
#include "xfa/fwl/cfwl_message.h"
#include "xfa/fwl/cfwl_notedriver.h"
CFWL_WidgetMgr::CFWL_WidgetMgr(AdapterIface* pAdapterNative)
: m_pAdapter(pAdapterNative) {
- m_mapWidgetItem[nullptr] = pdfium::MakeUnique<Item>();
+ m_mapWidgetItem[nullptr] = std::make_unique<Item>();
}
CFWL_WidgetMgr::~CFWL_WidgetMgr() = default;
@@ -154,7 +153,7 @@
void CFWL_WidgetMgr::InsertWidget(CFWL_Widget* pParent, CFWL_Widget* pChild) {
Item* pParentItem = GetWidgetMgrItem(pParent);
if (!pParentItem) {
- auto item = pdfium::MakeUnique<Item>(pParent);
+ auto item = std::make_unique<Item>(pParent);
pParentItem = item.get();
m_mapWidgetItem[pParent] = std::move(item);
@@ -164,7 +163,7 @@
Item* pItem = GetWidgetMgrItem(pChild);
if (!pItem) {
- auto item = pdfium::MakeUnique<Item>(pChild);
+ auto item = std::make_unique<Item>(pChild);
pItem = item.get();
m_mapWidgetItem[pChild] = std::move(item);
}
@@ -203,7 +202,7 @@
void CFWL_WidgetMgr::SetOwner(CFWL_Widget* pOwner, CFWL_Widget* pOwned) {
Item* pParentItem = GetWidgetMgrItem(pOwner);
if (!pParentItem) {
- auto item = pdfium::MakeUnique<Item>(pOwner);
+ auto item = std::make_unique<Item>(pOwner);
pParentItem = item.get();
m_mapWidgetItem[pOwner] = std::move(item);
@@ -213,7 +212,7 @@
Item* pItem = GetWidgetMgrItem(pOwned);
if (!pItem) {
- auto item = pdfium::MakeUnique<Item>(pOwned);
+ auto item = std::make_unique<Item>(pOwned);
pItem = item.get();
m_mapWidgetItem[pOwned] = std::move(item);
}
diff --git a/xfa/fwl/theme/cfwl_checkboxtp.cpp b/xfa/fwl/theme/cfwl_checkboxtp.cpp
index 6e4ae8b..953523d 100644
--- a/xfa/fwl/theme/cfwl_checkboxtp.cpp
+++ b/xfa/fwl/theme/cfwl_checkboxtp.cpp
@@ -8,7 +8,6 @@
#include "core/fxge/cfx_pathdata.h"
#include "core/fxge/render_defines.h"
-#include "third_party/base/ptr_util.h"
#include "xfa/fde/cfde_textout.h"
#include "xfa/fwl/cfwl_checkbox.h"
#include "xfa/fwl/cfwl_themebackground.h"
@@ -160,7 +159,7 @@
void CFWL_CheckBoxTP::InitCheckPath(float fCheckLen) {
if (!m_pCheckPath) {
- m_pCheckPath = pdfium::MakeUnique<CXFA_GEPath>();
+ m_pCheckPath = std::make_unique<CXFA_GEPath>();
float fWidth = kSignPath;
float fHeight = -kSignPath;
diff --git a/xfa/fwl/theme/cfwl_widgettp.cpp b/xfa/fwl/theme/cfwl_widgettp.cpp
index 383cb8a..975295c 100644
--- a/xfa/fwl/theme/cfwl_widgettp.cpp
+++ b/xfa/fwl/theme/cfwl_widgettp.cpp
@@ -10,7 +10,6 @@
#include <utility>
#include "core/fxge/render_defines.h"
-#include "third_party/base/ptr_util.h"
#include "third_party/base/stl_util.h"
#include "xfa/fde/cfde_textout.h"
#include "xfa/fgas/font/cfgas_fontmgr.h"
@@ -63,7 +62,7 @@
if (m_pColorData)
return;
- m_pColorData = pdfium::MakeUnique<CColorData>();
+ m_pColorData = std::make_unique<CColorData>();
m_pColorData->clrBorder[0] = ArgbEncode(255, 202, 216, 249);
m_pColorData->clrBorder[1] = ArgbEncode(255, 171, 190, 233);
m_pColorData->clrBorder[2] = ArgbEncode(255, 135, 147, 219);
@@ -87,7 +86,7 @@
return;
m_pFDEFont = CFWL_FontManager::GetInstance()->FindFont(L"Helvetica", 0, 0);
- m_pTextOut = pdfium::MakeUnique<CFDE_TextOut>();
+ m_pTextOut = std::make_unique<CFDE_TextOut>();
m_pTextOut->SetFont(m_pFDEFont);
m_pTextOut->SetFontSize(FWLTHEME_CAPACITY_FontSize);
m_pTextOut->SetTextColor(FWLTHEME_CAPACITY_TextColor);
@@ -239,7 +238,7 @@
m_dwStyles = dwFontStyles;
m_dwCodePage = dwCodePage;
if (!m_pFontMgr) {
- m_pFontMgr = pdfium::MakeUnique<CFGAS_FontMgr>();
+ m_pFontMgr = std::make_unique<CFGAS_FontMgr>();
if (!m_pFontMgr->EnumFonts())
m_pFontMgr = nullptr;
}
@@ -276,7 +275,7 @@
if (pData->Equal(wsFontFamily, dwFontStyles, wCodePage))
return pData->GetFont();
}
- auto pFontData = pdfium::MakeUnique<CFWL_FontData>();
+ auto pFontData = std::make_unique<CFWL_FontData>();
if (!pFontData->LoadFont(wsFontFamily, dwFontStyles, wCodePage))
return nullptr;
diff --git a/xfa/fxfa/cxfa_ffdoc.cpp b/xfa/fxfa/cxfa_ffdoc.cpp
index 695d366..631bfee 100644
--- a/xfa/fxfa/cxfa_ffdoc.cpp
+++ b/xfa/fxfa/cxfa_ffdoc.cpp
@@ -75,10 +75,10 @@
: m_pDocEnvironment(pDocEnvironment),
m_pApp(pApp),
m_pPDFDoc(pPDFDoc),
- m_pNotify(pdfium::MakeUnique<CXFA_FFNotify>(this)),
- m_pDocument(pdfium::MakeUnique<CXFA_Document>(
+ m_pNotify(std::make_unique<CXFA_FFNotify>(this)),
+ m_pDocument(std::make_unique<CXFA_Document>(
m_pNotify.get(),
- pdfium::MakeUnique<CXFA_LayoutProcessor>())) {}
+ std::make_unique<CXFA_LayoutProcessor>())) {}
CXFA_FFDoc::~CXFA_FFDoc() {
if (m_DocView) {
@@ -114,7 +114,7 @@
CXFA_FFDocView* CXFA_FFDoc::CreateDocView() {
if (!m_DocView)
- m_DocView = pdfium::MakeUnique<CXFA_FFDocView>(this);
+ m_DocView = std::make_unique<CXFA_FFDocView>(this);
return m_DocView.get();
}
@@ -138,7 +138,7 @@
// At this point we've got an XFA document and we want to always return
// true to signify the load succeeded.
- m_pPDFFontMgr = pdfium::MakeUnique<CFGAS_PDFFontMgr>(GetPDFDoc(), mgr);
+ m_pPDFFontMgr = std::make_unique<CFGAS_PDFFontMgr>(GetPDFDoc(), mgr);
m_FormType = FormType::kXFAForeground;
CXFA_Node* pConfig = ToNode(m_pDocument->GetXFAObject(XFA_HASHCODE_Config));
diff --git a/xfa/fxgraphics/cxfa_graphics.cpp b/xfa/fxgraphics/cxfa_graphics.cpp
index 0f90986..c74a617 100644
--- a/xfa/fxgraphics/cxfa_graphics.cpp
+++ b/xfa/fxgraphics/cxfa_graphics.cpp
@@ -13,7 +13,6 @@
#include "core/fxge/cfx_renderdevice.h"
#include "core/fxge/cfx_unicodeencoding.h"
#include "core/fxge/dib/cfx_dibitmap.h"
-#include "third_party/base/ptr_util.h"
#include "third_party/base/stl_util.h"
#include "xfa/fxgraphics/cxfa_gecolor.h"
#include "xfa/fxgraphics/cxfa_gepath.h"
@@ -119,7 +118,7 @@
void CXFA_Graphics::SaveGraphState() {
m_renderDevice->SaveState();
- m_infoStack.push_back(pdfium::MakeUnique<TInfo>(m_info));
+ m_infoStack.push_back(std::make_unique<TInfo>(m_info));
}
void CXFA_Graphics::RestoreGraphState() {