Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1124)

Unified Diff: xfa/fgas/layout/fgas_textbreak.cpp

Issue 2571913002: Avoid the ptr.reset(new XXX()) anti-pattern (Closed)
Patch Set: rebase Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « xfa/fde/tto/fde_textout.cpp ('k') | xfa/fwl/cfwl_combobox.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/fgas/layout/fgas_textbreak.cpp
diff --git a/xfa/fgas/layout/fgas_textbreak.cpp b/xfa/fgas/layout/fgas_textbreak.cpp
index 4b6e22593d02134ebe80a27d077f3a43ad359a01..a3f8e9841de4d2e2197d371a70088bda0d6a1e02 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();
}
« no previous file with comments | « xfa/fde/tto/fde_textout.cpp ('k') | xfa/fwl/cfwl_combobox.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698