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

Side by Side Diff: xfa/fwl/lightwidget/cfwl_barcode.cpp

Issue 1943413002: Convert FWL_ERR into an enum class. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@bcdattribute
Patch Set: Created 4 years, 7 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
« no previous file with comments | « xfa/fwl/lightwidget/cfwl_barcode.h ('k') | xfa/fwl/lightwidget/cfwl_checkbox.h » ('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/lightwidget/cfwl_barcode.h" 7 #include "xfa/fwl/lightwidget/cfwl_barcode.h"
8 8
9 #include <memory> 9 #include <memory>
10 10
11 CFWL_Barcode* CFWL_Barcode::Create() { 11 CFWL_Barcode* CFWL_Barcode::Create() {
12 return new CFWL_Barcode; 12 return new CFWL_Barcode;
13 } 13 }
14 14
15 FWL_ERR CFWL_Barcode::Initialize(const CFWL_WidgetProperties* pProperties) { 15 FWL_Error CFWL_Barcode::Initialize(const CFWL_WidgetProperties* pProperties) {
16 if (m_pIface) 16 if (m_pIface)
17 return FWL_ERR_Indefinite; 17 return FWL_Error::Indefinite;
18 if (pProperties) { 18 if (pProperties) {
19 *m_pProperties = *pProperties; 19 *m_pProperties = *pProperties;
20 } 20 }
21 std::unique_ptr<IFWL_Barcode> pBarcode(IFWL_Barcode::Create( 21 std::unique_ptr<IFWL_Barcode> pBarcode(IFWL_Barcode::Create(
22 m_pProperties->MakeWidgetImpProperties(&m_barcodeData))); 22 m_pProperties->MakeWidgetImpProperties(&m_barcodeData)));
23 FWL_ERR ret = pBarcode->Initialize(); 23 FWL_Error ret = pBarcode->Initialize();
24 if (ret != FWL_ERR_Succeeded) { 24 if (ret != FWL_Error::Succeeded) {
25 return ret; 25 return ret;
26 } 26 }
27 m_pIface = pBarcode.release(); 27 m_pIface = pBarcode.release();
28 CFWL_Widget::Initialize(); 28 CFWL_Widget::Initialize();
29 return FWL_ERR_Succeeded; 29 return FWL_Error::Succeeded;
30 } 30 }
31 31
32 CFWL_Barcode::CFWL_Barcode() {} 32 CFWL_Barcode::CFWL_Barcode() {}
33 33
34 CFWL_Barcode::~CFWL_Barcode() {} 34 CFWL_Barcode::~CFWL_Barcode() {}
35 35
36 void CFWL_Barcode::SetType(BC_TYPE type) { 36 void CFWL_Barcode::SetType(BC_TYPE type) {
37 if (!m_pIface) 37 if (!m_pIface)
38 return; 38 return;
39 static_cast<IFWL_Barcode*>(m_pIface)->SetType(type); 39 static_cast<IFWL_Barcode*>(m_pIface)->SetType(type);
40 } 40 }
41 41
42 FX_BOOL CFWL_Barcode::IsProtectedType() { 42 FX_BOOL CFWL_Barcode::IsProtectedType() {
43 if (!m_pIface) 43 if (!m_pIface)
44 return 0; 44 return 0;
45 return static_cast<IFWL_Barcode*>(m_pIface)->IsProtectedType(); 45 return static_cast<IFWL_Barcode*>(m_pIface)->IsProtectedType();
46 } 46 }
47 FWL_ERR CFWL_Barcode::CFWL_BarcodeDP::GetCaption(IFWL_Widget* pWidget, 47 FWL_Error CFWL_Barcode::CFWL_BarcodeDP::GetCaption(IFWL_Widget* pWidget,
48 CFX_WideString& wsCaption) { 48 CFX_WideString& wsCaption) {
49 return FWL_ERR_Succeeded; 49 return FWL_Error::Succeeded;
50 } 50 }
OLDNEW
« no previous file with comments | « xfa/fwl/lightwidget/cfwl_barcode.h ('k') | xfa/fwl/lightwidget/cfwl_checkbox.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698