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

Side by Side Diff: xfa/fwl/cfwl_combobox.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/fgas/layout/fgas_textbreak.cpp ('k') | xfa/fwl/cfwl_datetimepicker.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/fwl/cfwl_combobox.h" 7 #include "xfa/fwl/cfwl_combobox.h"
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <memory> 10 #include <memory>
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 49
50 auto prop = pdfium::MakeUnique<CFWL_WidgetProperties>(); 50 auto prop = pdfium::MakeUnique<CFWL_WidgetProperties>();
51 prop->m_pThemeProvider = m_pProperties->m_pThemeProvider; 51 prop->m_pThemeProvider = m_pProperties->m_pThemeProvider;
52 prop->m_dwStyles |= FWL_WGTSTYLE_Border | FWL_WGTSTYLE_VScroll; 52 prop->m_dwStyles |= FWL_WGTSTYLE_Border | FWL_WGTSTYLE_VScroll;
53 if (m_pProperties->m_dwStyleExes & FWL_STYLEEXT_CMB_ListItemIconText) 53 if (m_pProperties->m_dwStyleExes & FWL_STYLEEXT_CMB_ListItemIconText)
54 prop->m_dwStyleExes |= FWL_STYLEEXT_LTB_Icon; 54 prop->m_dwStyleExes |= FWL_STYLEEXT_LTB_Icon;
55 m_pListBox = 55 m_pListBox =
56 pdfium::MakeUnique<CFWL_ComboList>(m_pOwnerApp, std::move(prop), this); 56 pdfium::MakeUnique<CFWL_ComboList>(m_pOwnerApp, std::move(prop), this);
57 57
58 if ((m_pProperties->m_dwStyleExes & FWL_STYLEEXT_CMB_DropDown) && !m_pEdit) { 58 if ((m_pProperties->m_dwStyleExes & FWL_STYLEEXT_CMB_DropDown) && !m_pEdit) {
59 m_pEdit.reset(new CFWL_ComboEdit( 59 m_pEdit = pdfium::MakeUnique<CFWL_ComboEdit>(
60 m_pOwnerApp, pdfium::MakeUnique<CFWL_WidgetProperties>(), this)); 60 m_pOwnerApp, pdfium::MakeUnique<CFWL_WidgetProperties>(), this);
61 m_pEdit->SetOuter(this); 61 m_pEdit->SetOuter(this);
62 } 62 }
63 if (m_pEdit) 63 if (m_pEdit)
64 m_pEdit->SetParent(this); 64 m_pEdit->SetParent(this);
65 65
66 SetStates(m_pProperties->m_dwStates); 66 SetStates(m_pProperties->m_dwStates);
67 } 67 }
68 68
69 CFWL_ComboBox::~CFWL_ComboBox() {} 69 CFWL_ComboBox::~CFWL_ComboBox() {}
70 70
(...skipping 990 matching lines...) Expand 10 before | Expand all | Expand 10 after
1061 else 1061 else
1062 iCurSel++; 1062 iCurSel++;
1063 } 1063 }
1064 m_iCurSel = iCurSel; 1064 m_iCurSel = iCurSel;
1065 SyncEditText(m_iCurSel); 1065 SyncEditText(m_iCurSel);
1066 return; 1066 return;
1067 } 1067 }
1068 if (m_pEdit) 1068 if (m_pEdit)
1069 m_pEdit->GetDelegate()->OnProcessMessage(pMsg); 1069 m_pEdit->GetDelegate()->OnProcessMessage(pMsg);
1070 } 1070 }
OLDNEW
« no previous file with comments | « xfa/fgas/layout/fgas_textbreak.cpp ('k') | xfa/fwl/cfwl_datetimepicker.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698