From 3b91290ba31e1d5bd0147f44f9cc723a72b6eb9a Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Fri, 28 Apr 2017 13:33:31 -0700 Subject: Remove more |new|s, part 3 These are already unique_ptr's, we should make them as such. Change-Id: I576396d73c1d39e7a3bc8f91e8530d2e08883213 Reviewed-on: https://pdfium-review.googlesource.com/4614 Reviewed-by: Lei Zhang Commit-Queue: Tom Sepez --- xfa/fxfa/cxfa_widgetacc.cpp | 4 ++-- xfa/fxfa/parser/cxfa_localemgr.cpp | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'xfa/fxfa') diff --git a/xfa/fxfa/cxfa_widgetacc.cpp b/xfa/fxfa/cxfa_widgetacc.cpp index ad8f4bf5fa..23327b7691 100644 --- a/xfa/fxfa/cxfa_widgetacc.cpp +++ b/xfa/fxfa/cxfa_widgetacc.cpp @@ -108,8 +108,8 @@ class CXFA_FieldLayoutData : public CXFA_WidgetLayoutData { CXFA_Caption caption = pAcc->GetCaption(); if (!caption || caption.GetPresence() == XFA_ATTRIBUTEENUM_Hidden) return false; - m_pCapTextProvider.reset( - new CXFA_TextProvider(pAcc, XFA_TEXTPROVIDERTYPE_Caption)); + m_pCapTextProvider = pdfium::MakeUnique( + pAcc, XFA_TEXTPROVIDERTYPE_Caption); m_pCapTextLayout = pdfium::MakeUnique(m_pCapTextProvider.get()); return true; diff --git a/xfa/fxfa/parser/cxfa_localemgr.cpp b/xfa/fxfa/parser/cxfa_localemgr.cpp index 0f50803763..0a691a6ceb 100644 --- a/xfa/fxfa/parser/cxfa_localemgr.cpp +++ b/xfa/fxfa/parser/cxfa_localemgr.cpp @@ -14,6 +14,7 @@ #include "core/fxcodec/fx_codec.h" #include "core/fxcrt/xml/cxml_element.h" #include "core/fxge/cfx_gemodule.h" +#include "third_party/base/ptr_util.h" #include "xfa/fxfa/parser/cxfa_node.h" #include "xfa/fxfa/parser/cxfa_nodelocale.h" #include "xfa/fxfa/parser/cxfa_xmllocale.h" @@ -1072,8 +1073,7 @@ static std::unique_ptr XFA_GetLocaleFromBuffer(const uint8_t* pBuf, pLocale = CXML_Element::Parse(pOut, dwSize); FX_Free(pOut); } - return pLocale ? std::unique_ptr( - new CXFA_XMLLocale(std::move(pLocale))) + return pLocale ? pdfium::MakeUnique(std::move(pLocale)) : nullptr; } @@ -1127,7 +1127,7 @@ CXFA_LocaleMgr::CXFA_LocaleMgr(CXFA_Node* pLocaleSet, CFX_WideString wsDeflcid) if (pLocaleSet) { CXFA_Node* pNodeLocale = pLocaleSet->GetNodeItem(XFA_NODEITEM_FirstChild); while (pNodeLocale) { - m_LocaleArray.emplace_back(new CXFA_NodeLocale(pNodeLocale)); + m_LocaleArray.push_back(pdfium::MakeUnique(pNodeLocale)); pNodeLocale = pNodeLocale->GetNodeItem(XFA_NODEITEM_NextSibling); } } -- cgit v1.2.3