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

Side by Side Diff: xfa/fxfa/app/xfa_ffbarcode.cpp

Issue 2436103002: Remove FWL globals. (Closed)
Patch Set: Review feedback 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 | « xfa/fxfa/app/xfa_ffapp.cpp ('k') | xfa/fxfa/app/xfa_ffcheckbutton.cpp » ('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/fxfa/app/xfa_ffbarcode.h" 7 #include "xfa/fxfa/app/xfa_ffbarcode.h"
8 8
9 #include "core/fxcrt/fx_ext.h" 9 #include "core/fxcrt/fx_ext.h"
10 #include "xfa/fwl/core/cfwl_barcode.h" 10 #include "xfa/fwl/core/cfwl_barcode.h"
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 } 112 }
113 } while (iStart <= iEnd); 113 } while (iStart <= iEnd);
114 return nullptr; 114 return nullptr;
115 } 115 }
116 116
117 } // namespace. 117 } // namespace.
118 118
119 CXFA_FFBarcode::CXFA_FFBarcode(CXFA_FFPageView* pPageView, 119 CXFA_FFBarcode::CXFA_FFBarcode(CXFA_FFPageView* pPageView,
120 CXFA_WidgetAcc* pDataAcc) 120 CXFA_WidgetAcc* pDataAcc)
121 : CXFA_FFTextEdit(pPageView, pDataAcc) {} 121 : CXFA_FFTextEdit(pPageView, pDataAcc) {}
122
122 CXFA_FFBarcode::~CXFA_FFBarcode() {} 123 CXFA_FFBarcode::~CXFA_FFBarcode() {}
124
123 FX_BOOL CXFA_FFBarcode::LoadWidget() { 125 FX_BOOL CXFA_FFBarcode::LoadWidget() {
124 CFWL_Barcode* pFWLBarcode = new CFWL_Barcode; 126 CFWL_Barcode* pFWLBarcode = new CFWL_Barcode(GetFWLApp());
125 pFWLBarcode->Initialize(); 127 pFWLBarcode->Initialize(nullptr);
126 128
127 m_pNormalWidget = pFWLBarcode; 129 m_pNormalWidget = pFWLBarcode;
128 m_pNormalWidget->SetLayoutItem(this); 130 m_pNormalWidget->SetLayoutItem(this);
129 IFWL_Widget* pWidget = m_pNormalWidget->GetWidget(); 131 IFWL_Widget* pWidget = m_pNormalWidget->GetWidget();
130 CFWL_NoteDriver* pNoteDriver = FWL_GetApp()->GetNoteDriver(); 132 CFWL_NoteDriver* pNoteDriver = pWidget->GetOwnerApp()->GetNoteDriver();
131 pNoteDriver->RegisterEventTarget(pWidget, pWidget); 133 pNoteDriver->RegisterEventTarget(pWidget, pWidget);
132 m_pOldDelegate = m_pNormalWidget->SetDelegate(this); 134 m_pOldDelegate = m_pNormalWidget->SetDelegate(this);
133 m_pNormalWidget->LockUpdate(); 135 m_pNormalWidget->LockUpdate();
134 CFX_WideString wsText; 136 CFX_WideString wsText;
135 m_pDataAcc->GetValue(wsText, XFA_VALUEPICTURE_Display); 137 m_pDataAcc->GetValue(wsText, XFA_VALUEPICTURE_Display);
136 pFWLBarcode->SetText(wsText); 138 pFWLBarcode->SetText(wsText);
137 UpdateWidgetProperty(); 139 UpdateWidgetProperty();
138 m_pNormalWidget->UnlockUpdate(); 140 m_pNormalWidget->UnlockUpdate();
139 return CXFA_FFField::LoadWidget(); 141 return CXFA_FFField::LoadWidget();
140 } 142 }
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 } 236 }
235 FX_BOOL CXFA_FFBarcode::OnRButtonDown(uint32_t dwFlags, 237 FX_BOOL CXFA_FFBarcode::OnRButtonDown(uint32_t dwFlags,
236 FX_FLOAT fx, 238 FX_FLOAT fx,
237 FX_FLOAT fy) { 239 FX_FLOAT fy) {
238 CFWL_Barcode* pBarCodeWidget = (CFWL_Barcode*)m_pNormalWidget; 240 CFWL_Barcode* pBarCodeWidget = (CFWL_Barcode*)m_pNormalWidget;
239 if (!pBarCodeWidget || pBarCodeWidget->IsProtectedType()) { 241 if (!pBarCodeWidget || pBarCodeWidget->IsProtectedType()) {
240 return FALSE; 242 return FALSE;
241 } 243 }
242 return CXFA_FFTextEdit::OnRButtonDown(dwFlags, fx, fy); 244 return CXFA_FFTextEdit::OnRButtonDown(dwFlags, fx, fy);
243 } 245 }
OLDNEW
« no previous file with comments | « xfa/fxfa/app/xfa_ffapp.cpp ('k') | xfa/fxfa/app/xfa_ffcheckbutton.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698