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

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

Issue 2004213002: Remove IWFL_WidgetMgr in favor of CFWL_WidgetMgr (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
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/core/ifwl_widgetmgr.h ('k') | xfa/fwl/theme/cfwl_widgettp.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/fwl/lightwidget/cfwl_widget.h" 7 #include "xfa/fwl/lightwidget/cfwl_widget.h"
8 8
9 #include "xfa/fde/tto/fde_textout.h" 9 #include "xfa/fde/tto/fde_textout.h"
10 #include "xfa/fwl/core/cfwl_themetext.h" 10 #include "xfa/fwl/core/cfwl_themetext.h"
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 if (!m_pIface) 210 if (!m_pIface)
211 return nullptr; 211 return nullptr;
212 212
213 m_pDelegate = m_pIface->SetDelegate(pDelegate); 213 m_pDelegate = m_pIface->SetDelegate(pDelegate);
214 return m_pDelegate; 214 return m_pDelegate;
215 } 215 }
216 216
217 CFWL_Widget::CFWL_Widget() 217 CFWL_Widget::CFWL_Widget()
218 : m_pIface(nullptr), m_pDelegate(nullptr), m_pProperties(nullptr) { 218 : m_pIface(nullptr), m_pDelegate(nullptr), m_pProperties(nullptr) {
219 m_pProperties = new CFWL_WidgetProperties; 219 m_pProperties = new CFWL_WidgetProperties;
220 m_pWidgetMgr = static_cast<CFWL_WidgetMgr*>(FWL_GetWidgetMgr()); 220 m_pWidgetMgr = static_cast<CFWL_WidgetMgr*>(IFWL_WidgetMgr::GetInstance());
Lei Zhang 2016/05/23 21:57:20 Do we want to get rid of IFWL_WidgetMgr altogether
Tom Sepez 2016/05/23 22:02:54 Yes, I think so.
221 ASSERT(m_pWidgetMgr); 221 ASSERT(m_pWidgetMgr);
222 } 222 }
223 223
224 CFWL_Widget::~CFWL_Widget() { 224 CFWL_Widget::~CFWL_Widget() {
225 delete m_pProperties; 225 delete m_pProperties;
226 if (m_pIface) { 226 if (m_pIface) {
227 m_pIface->Finalize(); 227 m_pIface->Finalize();
228 delete m_pIface; 228 delete m_pIface;
229 } 229 }
230 } 230 }
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
334 calPart.m_iTTOAlign = FDE_TTOALIGNMENT_TopLeft; 334 calPart.m_iTTOAlign = FDE_TTOALIGNMENT_TopLeft;
335 CFX_RectF rect; 335 CFX_RectF rect;
336 FX_FLOAT fWidth = bMultiLine 336 FX_FLOAT fWidth = bMultiLine
337 ? (iLineWidth > 0 ? (FX_FLOAT)iLineWidth 337 ? (iLineWidth > 0 ? (FX_FLOAT)iLineWidth
338 : FWL_WGT_CalcMultiLineDefWidth) 338 : FWL_WGT_CalcMultiLineDefWidth)
339 : FWL_WGT_CalcWidth; 339 : FWL_WGT_CalcWidth;
340 rect.Set(0, 0, fWidth, FWL_WGT_CalcHeight); 340 rect.Set(0, 0, fWidth, FWL_WGT_CalcHeight);
341 pTheme->CalcTextRect(&calPart, rect); 341 pTheme->CalcTextRect(&calPart, rect);
342 return CFX_SizeF(rect.width, rect.height); 342 return CFX_SizeF(rect.width, rect.height);
343 } 343 }
OLDNEW
« no previous file with comments | « xfa/fwl/core/ifwl_widgetmgr.h ('k') | xfa/fwl/theme/cfwl_widgettp.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698