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

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

Issue 2464703006: Fold IFWL*::{Initialize|Finalize} into constructor/destructor (Closed)
Patch Set: Rebase to master Created 4 years, 1 month 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 | « no previous file | xfa/fwl/core/cfwl_checkbox.cpp » ('j') | xfa/fwl/core/ifwl_barcode.cpp » ('J')
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/core/cfwl_barcode.h" 7 #include "xfa/fwl/core/cfwl_barcode.h"
8 8
9 #include <memory> 9 #include <memory>
10 10
11 #include "third_party/base/ptr_util.h"
12
11 namespace { 13 namespace {
12 14
13 IFWL_Barcode* ToBarcode(IFWL_Widget* widget) { 15 IFWL_Barcode* ToBarcode(IFWL_Widget* widget) {
14 return static_cast<IFWL_Barcode*>(widget); 16 return static_cast<IFWL_Barcode*>(widget);
15 } 17 }
16 18
17 } // namespace 19 } // namespace
18 20
19 CFWL_Barcode::CFWL_Barcode(const IFWL_App* app) : CFWL_Edit(app) {} 21 CFWL_Barcode::CFWL_Barcode(const IFWL_App* app) : CFWL_Edit(app) {}
20 22
21 CFWL_Barcode::~CFWL_Barcode() {} 23 CFWL_Barcode::~CFWL_Barcode() {}
22 24
23 void CFWL_Barcode::Initialize() { 25 void CFWL_Barcode::Initialize() {
24 ASSERT(!m_pIface); 26 ASSERT(!m_pIface);
25 std::unique_ptr<IFWL_Barcode> pBarcode(new IFWL_Barcode(
26 m_pApp, m_pProperties->MakeWidgetImpProperties(&m_barcodeData)));
27 pBarcode->Initialize();
28 27
29 m_pIface = std::move(pBarcode); 28 m_pIface = pdfium::MakeUnique<IFWL_Barcode>(
29 m_pApp, m_pProperties->MakeWidgetImpProperties(&m_barcodeData));
30
30 CFWL_Widget::Initialize(); 31 CFWL_Widget::Initialize();
31 } 32 }
32 33
33 void CFWL_Barcode::SetCharEncoding(BC_CHAR_ENCODING encoding) { 34 void CFWL_Barcode::SetCharEncoding(BC_CHAR_ENCODING encoding) {
34 m_barcodeData.m_dwAttributeMask |= FWL_BCDATTRIBUTE_CHARENCODING; 35 m_barcodeData.m_dwAttributeMask |= FWL_BCDATTRIBUTE_CHARENCODING;
35 m_barcodeData.m_eCharEncoding = encoding; 36 m_barcodeData.m_eCharEncoding = encoding;
36 } 37 }
37 void CFWL_Barcode::SetModuleHeight(int32_t height) { 38 void CFWL_Barcode::SetModuleHeight(int32_t height) {
38 m_barcodeData.m_dwAttributeMask |= FWL_BCDATTRIBUTE_MODULEHEIGHT; 39 m_barcodeData.m_dwAttributeMask |= FWL_BCDATTRIBUTE_MODULEHEIGHT;
39 m_barcodeData.m_nModuleHeight = height; 40 m_barcodeData.m_nModuleHeight = height;
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 return m_nECLevel; 153 return m_nECLevel;
153 } 154 }
154 155
155 FX_BOOL CFWL_Barcode::CFWL_BarcodeDP::GetTruncated() const { 156 FX_BOOL CFWL_Barcode::CFWL_BarcodeDP::GetTruncated() const {
156 return m_bTruncated; 157 return m_bTruncated;
157 } 158 }
158 159
159 uint32_t CFWL_Barcode::CFWL_BarcodeDP::GetBarcodeAttributeMask() const { 160 uint32_t CFWL_Barcode::CFWL_BarcodeDP::GetBarcodeAttributeMask() const {
160 return m_dwAttributeMask; 161 return m_dwAttributeMask;
161 } 162 }
OLDNEW
« no previous file with comments | « no previous file | xfa/fwl/core/cfwl_checkbox.cpp » ('j') | xfa/fwl/core/ifwl_barcode.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698