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

Side by Side Diff: xfa/src/fwl/src/lightwidget/checkbox.cpp

Issue 1545183002: Merge to XFA: Switch from nonstd::unique_ptr to std::unique_ptr. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: xfa Created 4 years, 12 months 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
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 <memory>
8
7 #include "../../../foxitlib.h" 9 #include "../../../foxitlib.h"
10
8 CFWL_CheckBox* CFWL_CheckBox::Create() { 11 CFWL_CheckBox* CFWL_CheckBox::Create() {
9 return new CFWL_CheckBox; 12 return new CFWL_CheckBox;
10 } 13 }
11 FWL_ERR CFWL_CheckBox::Initialize(const CFWL_WidgetProperties* pProperties) { 14 FWL_ERR CFWL_CheckBox::Initialize(const CFWL_WidgetProperties* pProperties) {
12 if (m_pIface) 15 if (m_pIface)
13 return FWL_ERR_Indefinite; 16 return FWL_ERR_Indefinite;
14 if (pProperties) { 17 if (pProperties) {
15 *m_pProperties = *pProperties; 18 *m_pProperties = *pProperties;
16 } 19 }
17 nonstd::unique_ptr<IFWL_CheckBox> pCheckBox(IFWL_CheckBox::Create( 20 std::unique_ptr<IFWL_CheckBox> pCheckBox(IFWL_CheckBox::Create(
18 m_pProperties->MakeWidgetImpProperties(&m_checkboxData), nullptr)); 21 m_pProperties->MakeWidgetImpProperties(&m_checkboxData), nullptr));
19 FWL_ERR ret = pCheckBox->Initialize(); 22 FWL_ERR ret = pCheckBox->Initialize();
20 if (ret != FWL_ERR_Succeeded) { 23 if (ret != FWL_ERR_Succeeded) {
21 return ret; 24 return ret;
22 } 25 }
23 m_pIface = pCheckBox.release(); 26 m_pIface = pCheckBox.release();
24 CFWL_Widget::Initialize(); 27 CFWL_Widget::Initialize();
25 return FWL_ERR_Succeeded; 28 return FWL_ERR_Succeeded;
26 } 29 }
27 FWL_ERR CFWL_CheckBox::SetCaption(const CFX_WideStringC& wsCaption) { 30 FWL_ERR CFWL_CheckBox::SetCaption(const CFX_WideStringC& wsCaption) {
(...skipping 15 matching lines...) Expand all
43 CFWL_CheckBox::CFWL_CheckBoxDP::CFWL_CheckBoxDP() 46 CFWL_CheckBox::CFWL_CheckBoxDP::CFWL_CheckBoxDP()
44 : m_fBoxHeight(16.0f), m_wsCaption(L"Check box") {} 47 : m_fBoxHeight(16.0f), m_wsCaption(L"Check box") {}
45 FWL_ERR CFWL_CheckBox::CFWL_CheckBoxDP::GetCaption(IFWL_Widget* pWidget, 48 FWL_ERR CFWL_CheckBox::CFWL_CheckBoxDP::GetCaption(IFWL_Widget* pWidget,
46 CFX_WideString& wsCaption) { 49 CFX_WideString& wsCaption) {
47 wsCaption = m_wsCaption; 50 wsCaption = m_wsCaption;
48 return FWL_ERR_Succeeded; 51 return FWL_ERR_Succeeded;
49 } 52 }
50 FX_FLOAT CFWL_CheckBox::CFWL_CheckBoxDP::GetBoxSize(IFWL_Widget* pWidget) { 53 FX_FLOAT CFWL_CheckBox::CFWL_CheckBoxDP::GetBoxSize(IFWL_Widget* pWidget) {
51 return m_fBoxHeight; 54 return m_fBoxHeight;
52 } 55 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698