summaryrefslogtreecommitdiff
path: root/xfa/fgas
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-12-14 05:57:10 -0800
committerCommit bot <commit-bot@chromium.org>2016-12-14 05:57:10 -0800
commita9caab94c1f16929e5acf2676117224617d80f53 (patch)
treed71ff9a82fae6e6080deb76375f43056127b3ee2 /xfa/fgas
parent992ecf7c189e5cabf43e5ad862511cf63d030966 (diff)
downloadpdfium-a9caab94c1f16929e5acf2676117224617d80f53.tar.xz
Avoid the ptr.reset(new XXX()) anti-pattern
Be suspicious of |new|. This removes some of the easy cases. Review-Url: https://codereview.chromium.org/2571913002
Diffstat (limited to 'xfa/fgas')
-rw-r--r--xfa/fgas/layout/fgas_textbreak.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/xfa/fgas/layout/fgas_textbreak.cpp b/xfa/fgas/layout/fgas_textbreak.cpp
index 4b6e22593d..a3f8e9841d 100644
--- a/xfa/fgas/layout/fgas_textbreak.cpp
+++ b/xfa/fgas/layout/fgas_textbreak.cpp
@@ -11,6 +11,7 @@
#include "core/fxcrt/fx_arabic.h"
#include "core/fxcrt/fx_arb.h"
#include "core/fxcrt/fx_memory.h"
+#include "third_party/base/ptr_util.h"
#include "xfa/fgas/font/cfgas_gefont.h"
#include "xfa/fgas/layout/fgas_linebreak.h"
#include "xfa/fgas/layout/fgas_unicode.h"
@@ -70,8 +71,8 @@ CFX_TxtBreak::CFX_TxtBreak(uint32_t dwPolicies)
m_iCharSpace(0) {
m_bPagination = (m_dwPolicies & FX_TXTBREAKPOLICY_Pagination) != 0;
int32_t iSize = m_bPagination ? sizeof(CFX_Char) : sizeof(CFX_TxtChar);
- m_pTxtLine1.reset(new CFX_TxtLine(iSize));
- m_pTxtLine2.reset(new CFX_TxtLine(iSize));
+ m_pTxtLine1 = pdfium::MakeUnique<CFX_TxtLine>(iSize);
+ m_pTxtLine2 = pdfium::MakeUnique<CFX_TxtLine>(iSize);
m_pCurLine = m_pTxtLine1.get();
ResetArabicContext();
}