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

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

Issue 2435603003: Cleanup unused methods and return values in FWL code. (Closed)
Patch Set: Fix typo 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
« no previous file with comments | « xfa/fwl/core/ifwl_barcode.h ('k') | xfa/fwl/core/ifwl_caret.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/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 CFWL_WidgetImpProperties& properties)
16 : IFWL_Edit(properties, nullptr), m_dwStatus(0), m_type(BC_UNKNOWN) {} 16 : IFWL_Edit(properties, nullptr), m_dwStatus(0), m_type(BC_UNKNOWN) {}
17 17
18 IFWL_Barcode::~IFWL_Barcode() {} 18 IFWL_Barcode::~IFWL_Barcode() {}
19 19
20 FWL_Error IFWL_Barcode::GetClassName(CFX_WideString& wsClass) const {
21 wsClass = FWL_CLASS_Barcode;
22 return FWL_Error::Succeeded;
23 }
24
25 FWL_Type IFWL_Barcode::GetClassID() const { 20 FWL_Type IFWL_Barcode::GetClassID() const {
26 return FWL_Type::Barcode; 21 return FWL_Type::Barcode;
27 } 22 }
28 23
29 FWL_Error IFWL_Barcode::Initialize() { 24 FWL_Error IFWL_Barcode::Initialize() {
30 if (!m_pDelegate) { 25 if (!m_pDelegate) {
31 m_pDelegate = new CFWL_BarcodeImpDelegate(this); 26 m_pDelegate = new CFWL_BarcodeImpDelegate(this);
32 } 27 }
33 if (IFWL_Edit::Initialize() != FWL_Error::Succeeded) 28 if (IFWL_Edit::Initialize() != FWL_Error::Succeeded)
34 return FWL_Error::Indefinite; 29 return FWL_Error::Indefinite;
35 return FWL_Error::Succeeded; 30 return FWL_Error::Succeeded;
36 } 31 }
37 FWL_Error IFWL_Barcode::Finalize() { 32
33 void IFWL_Barcode::Finalize() {
38 delete m_pDelegate; 34 delete m_pDelegate;
39 m_pDelegate = nullptr; 35 m_pDelegate = nullptr;
40 m_pBarcodeEngine.reset(); 36 m_pBarcodeEngine.reset();
41 return IFWL_Edit::Finalize(); 37 IFWL_Edit::Finalize();
42 } 38 }
39
43 FWL_Error IFWL_Barcode::Update() { 40 FWL_Error IFWL_Barcode::Update() {
44 if (IsLocked()) { 41 if (IsLocked()) {
45 return FWL_Error::Indefinite; 42 return FWL_Error::Indefinite;
46 } 43 }
47 FWL_Error ret = IFWL_Edit::Update(); 44 FWL_Error ret = IFWL_Edit::Update();
48 GenerateBarcodeImageCache(); 45 GenerateBarcodeImageCache();
49 return ret; 46 return ret;
50 } 47 }
48
51 FWL_Error IFWL_Barcode::DrawWidget(CFX_Graphics* pGraphics, 49 FWL_Error IFWL_Barcode::DrawWidget(CFX_Graphics* pGraphics,
52 const CFX_Matrix* pMatrix) { 50 const CFX_Matrix* pMatrix) {
53 if (!pGraphics) 51 if (!pGraphics)
54 return FWL_Error::Indefinite; 52 return FWL_Error::Indefinite;
55 if (!m_pProperties->m_pThemeProvider) 53 if (!m_pProperties->m_pThemeProvider)
56 return FWL_Error::Indefinite; 54 return FWL_Error::Indefinite;
57 if ((m_pProperties->m_dwStates & FWL_WGTSTATE_Focused) == 0) { 55 if ((m_pProperties->m_dwStates & FWL_WGTSTATE_Focused) == 0) {
58 GenerateBarcodeImageCache(); 56 GenerateBarcodeImageCache();
59 if (!m_pBarcodeEngine || (m_dwStatus & XFA_BCS_EncodeSuccess) == 0) { 57 if (!m_pBarcodeEngine || (m_dwStatus & XFA_BCS_EncodeSuccess) == 0) {
60 return FWL_Error::Succeeded; 58 return FWL_Error::Succeeded;
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 : CFWL_EditImpDelegate(pOwner) {} 191 : CFWL_EditImpDelegate(pOwner) {}
194 192
195 void CFWL_BarcodeImpDelegate::OnProcessEvent(CFWL_Event* pEvent) { 193 void CFWL_BarcodeImpDelegate::OnProcessEvent(CFWL_Event* pEvent) {
196 if (pEvent->GetClassID() == CFWL_EventType::TextChanged) { 194 if (pEvent->GetClassID() == CFWL_EventType::TextChanged) {
197 IFWL_Barcode* pOwner = static_cast<IFWL_Barcode*>(m_pOwner); 195 IFWL_Barcode* pOwner = static_cast<IFWL_Barcode*>(m_pOwner);
198 pOwner->m_pBarcodeEngine.reset(); 196 pOwner->m_pBarcodeEngine.reset();
199 pOwner->m_dwStatus = XFA_BCS_NeedUpdate; 197 pOwner->m_dwStatus = XFA_BCS_NeedUpdate;
200 } 198 }
201 CFWL_EditImpDelegate::OnProcessEvent(pEvent); 199 CFWL_EditImpDelegate::OnProcessEvent(pEvent);
202 } 200 }
OLDNEW
« no previous file with comments | « xfa/fwl/core/ifwl_barcode.h ('k') | xfa/fwl/core/ifwl_caret.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698