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

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

Issue 2436103002: Remove FWL globals. (Closed)
Patch Set: fix mac Created 4 years, 2 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 "xfa/fwl/core/ifwl_barcode.h" 7 #include "xfa/fwl/core/ifwl_barcode.h"
8 8
9 #include "xfa/fgas/font/fgas_gefont.h" 9 #include "xfa/fgas/font/fgas_gefont.h"
10 #include "xfa/fwl/core/cfwl_themepart.h" 10 #include "xfa/fwl/core/cfwl_themepart.h"
11 #include "xfa/fwl/core/cfx_barcode.h" 11 #include "xfa/fwl/core/cfx_barcode.h"
12 #include "xfa/fwl/core/fwl_noteimp.h" 12 #include "xfa/fwl/core/fwl_noteimp.h"
13 #include "xfa/fwl/core/ifwl_themeprovider.h" 13 #include "xfa/fwl/core/ifwl_themeprovider.h"
14 14
15 IFWL_Barcode::IFWL_Barcode(const CFWL_WidgetImpProperties& properties) 15 IFWL_Barcode::IFWL_Barcode(const IFWL_App* app,
16 : IFWL_Edit(properties, nullptr), m_dwStatus(0), m_type(BC_UNKNOWN) {} 16 const CFWL_WidgetImpProperties& properties)
17 : IFWL_Edit(app, properties, nullptr), m_dwStatus(0), m_type(BC_UNKNOWN) {}
17 18
18 IFWL_Barcode::~IFWL_Barcode() {} 19 IFWL_Barcode::~IFWL_Barcode() {}
19 20
20 FWL_Type IFWL_Barcode::GetClassID() const { 21 FWL_Type IFWL_Barcode::GetClassID() const {
21 return FWL_Type::Barcode; 22 return FWL_Type::Barcode;
22 } 23 }
23 24
24 FWL_Error IFWL_Barcode::Initialize() { 25 void IFWL_Barcode::Initialize() {
25 if (!m_pDelegate) { 26 if (!m_pDelegate)
26 m_pDelegate = new CFWL_BarcodeImpDelegate(this); 27 m_pDelegate = new CFWL_BarcodeImpDelegate(this);
27 } 28
28 if (IFWL_Edit::Initialize() != FWL_Error::Succeeded) 29 IFWL_Edit::Initialize();
29 return FWL_Error::Indefinite;
30 return FWL_Error::Succeeded;
31 } 30 }
32 31
33 void IFWL_Barcode::Finalize() { 32 void IFWL_Barcode::Finalize() {
34 delete m_pDelegate; 33 delete m_pDelegate;
35 m_pDelegate = nullptr; 34 m_pDelegate = nullptr;
36 m_pBarcodeEngine.reset(); 35 m_pBarcodeEngine.reset();
37 IFWL_Edit::Finalize(); 36 IFWL_Edit::Finalize();
38 } 37 }
39 38
40 FWL_Error IFWL_Barcode::Update() { 39 FWL_Error IFWL_Barcode::Update() {
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 : CFWL_EditImpDelegate(pOwner) {} 190 : CFWL_EditImpDelegate(pOwner) {}
192 191
193 void CFWL_BarcodeImpDelegate::OnProcessEvent(CFWL_Event* pEvent) { 192 void CFWL_BarcodeImpDelegate::OnProcessEvent(CFWL_Event* pEvent) {
194 if (pEvent->GetClassID() == CFWL_EventType::TextChanged) { 193 if (pEvent->GetClassID() == CFWL_EventType::TextChanged) {
195 IFWL_Barcode* pOwner = static_cast<IFWL_Barcode*>(m_pOwner); 194 IFWL_Barcode* pOwner = static_cast<IFWL_Barcode*>(m_pOwner);
196 pOwner->m_pBarcodeEngine.reset(); 195 pOwner->m_pBarcodeEngine.reset();
197 pOwner->m_dwStatus = XFA_BCS_NeedUpdate; 196 pOwner->m_dwStatus = XFA_BCS_NeedUpdate;
198 } 197 }
199 CFWL_EditImpDelegate::OnProcessEvent(pEvent); 198 CFWL_EditImpDelegate::OnProcessEvent(pEvent);
200 } 199 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698