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

Side by Side Diff: xfa/fxfa/app/xfa_ffdocview.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 unified diff | Download patch
« no previous file with comments | « xfa/fxfa/app/xfa_ffdoc.cpp ('k') | xfa/fxfa/app/xfa_ffwidgetacc.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #include "xfa/fxfa/xfa_ffdocview.h" 7 #include "xfa/fxfa/xfa_ffdocview.h"
8 8
9 #include "core/fxcrt/fx_ext.h" 9 #include "core/fxcrt/fx_ext.h"
10 #include "third_party/base/ptr_util.h"
10 #include "third_party/base/stl_util.h" 11 #include "third_party/base/stl_util.h"
11 #include "xfa/fxfa/app/xfa_ffbarcode.h" 12 #include "xfa/fxfa/app/xfa_ffbarcode.h"
12 #include "xfa/fxfa/app/xfa_ffcheckbutton.h" 13 #include "xfa/fxfa/app/xfa_ffcheckbutton.h"
13 #include "xfa/fxfa/app/xfa_ffchoicelist.h" 14 #include "xfa/fxfa/app/xfa_ffchoicelist.h"
14 #include "xfa/fxfa/app/xfa_ffdraw.h" 15 #include "xfa/fxfa/app/xfa_ffdraw.h"
15 #include "xfa/fxfa/app/xfa_ffexclgroup.h" 16 #include "xfa/fxfa/app/xfa_ffexclgroup.h"
16 #include "xfa/fxfa/app/xfa_fffield.h" 17 #include "xfa/fxfa/app/xfa_fffield.h"
17 #include "xfa/fxfa/app/xfa_ffimage.h" 18 #include "xfa/fxfa/app/xfa_ffimage.h"
18 #include "xfa/fxfa/app/xfa_ffimageedit.h" 19 #include "xfa/fxfa/app/xfa_ffimageedit.h"
19 #include "xfa/fxfa/app/xfa_ffpath.h" 20 #include "xfa/fxfa/app/xfa_ffpath.h"
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 if (!pRootItem) { 307 if (!pRootItem) {
307 return XFA_EVENTERROR_Error; 308 return XFA_EVENTERROR_Error;
308 } 309 }
309 pNode = pRootItem->GetChild(0, XFA_Element::Subform); 310 pNode = pRootItem->GetChild(0, XFA_Element::Subform);
310 } 311 }
311 ExecEventActivityByDeepFirst(pNode, pParam->m_eType, pParam->m_bIsFormReady, 312 ExecEventActivityByDeepFirst(pNode, pParam->m_eType, pParam->m_bIsFormReady,
312 true, nullptr); 313 true, nullptr);
313 return XFA_EVENTERROR_Success; 314 return XFA_EVENTERROR_Success;
314 } 315 }
315 CXFA_FFWidgetHandler* CXFA_FFDocView::GetWidgetHandler() { 316 CXFA_FFWidgetHandler* CXFA_FFDocView::GetWidgetHandler() {
316 if (!m_pWidgetHandler) { 317 if (!m_pWidgetHandler)
317 m_pWidgetHandler.reset(new CXFA_FFWidgetHandler(this)); 318 m_pWidgetHandler = pdfium::MakeUnique<CXFA_FFWidgetHandler>(this);
318 } 319
319 return m_pWidgetHandler.get(); 320 return m_pWidgetHandler.get();
320 } 321 }
321 322
322 CXFA_WidgetAccIterator* CXFA_FFDocView::CreateWidgetAccIterator( 323 CXFA_WidgetAccIterator* CXFA_FFDocView::CreateWidgetAccIterator(
323 XFA_WIDGETORDER eOrder) { 324 XFA_WIDGETORDER eOrder) {
324 CXFA_Node* pFormRoot = GetRootSubform(); 325 CXFA_Node* pFormRoot = GetRootSubform();
325 return pFormRoot ? new CXFA_WidgetAccIterator(this, pFormRoot) : nullptr; 326 return pFormRoot ? new CXFA_WidgetAccIterator(this, pFormRoot) : nullptr;
326 } 327 }
327 CXFA_FFWidget* CXFA_FFDocView::GetFocusWidget() { 328 CXFA_FFWidget* CXFA_FFDocView::GetFocusWidget() {
328 return m_pFocusWidget; 329 return m_pFocusWidget;
(...skipping 522 matching lines...) Expand 10 before | Expand all | Expand 10 after
851 } 852 }
852 853
853 bool CXFA_WidgetAccIterator::SetCurrentWidgetAcc(CXFA_WidgetAcc* hWidget) { 854 bool CXFA_WidgetAccIterator::SetCurrentWidgetAcc(CXFA_WidgetAcc* hWidget) {
854 return false; 855 return false;
855 } 856 }
856 857
857 void CXFA_WidgetAccIterator::SkipTree() { 858 void CXFA_WidgetAccIterator::SkipTree() {
858 m_ContentIterator.SkipChildrenAndMoveToNext(); 859 m_ContentIterator.SkipChildrenAndMoveToNext();
859 m_pCurWidgetAcc = nullptr; 860 m_pCurWidgetAcc = nullptr;
860 } 861 }
OLDNEW
« no previous file with comments | « xfa/fxfa/app/xfa_ffdoc.cpp ('k') | xfa/fxfa/app/xfa_ffwidgetacc.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698