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

Unified Diff: xfa/fwl/core/ifwl_checkbox.cpp

Issue 2527683002: Remove DataProvider from CFWL_WidgetProperties (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « xfa/fwl/core/ifwl_checkbox.h ('k') | xfa/fwl/core/ifwl_combobox.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/fwl/core/ifwl_checkbox.cpp
diff --git a/xfa/fwl/core/ifwl_checkbox.cpp b/xfa/fwl/core/ifwl_checkbox.cpp
index 5268aceee78c02af073bb8a8d633577a8fa33867..b33eaa65593a91d48743dec0be09465c14cc8458 100644
--- a/xfa/fwl/core/ifwl_checkbox.cpp
+++ b/xfa/fwl/core/ifwl_checkbox.cpp
@@ -57,8 +57,6 @@ void IFWL_CheckBox::GetWidgetRect(CFX_RectF& rect, bool bAutoSize) {
m_pProperties->m_pThemeProvider = GetAvailableTheme();
if (!m_pProperties->m_pThemeProvider)
return;
- if (!m_pProperties->m_pDataProvider)
- return;
CFX_SizeF sz = CalcTextSize(
L"Check box", m_pProperties->m_pThemeProvider,
@@ -66,9 +64,7 @@ void IFWL_CheckBox::GetWidgetRect(CFX_RectF& rect, bool bAutoSize) {
rect.Set(0, 0, sz.x, sz.y);
rect.Inflate(kCaptionMargin, kCaptionMargin);
- IFWL_CheckBox::DataProvider* pData =
- static_cast<IFWL_CheckBox::DataProvider*>(m_pProperties->m_pDataProvider);
- FX_FLOAT fCheckBox = pData->GetBoxSize(this);
+ FX_FLOAT fCheckBox = m_pDataProvider->GetBoxSize(this);
rect.width += fCheckBox;
rect.height = std::max(rect.height, fCheckBox);
IFWL_Widget::GetWidgetRect(rect, true);
@@ -117,9 +113,6 @@ void IFWL_CheckBox::DrawWidget(CFX_Graphics* pGraphics,
param.m_rtPart = m_rtBox;
pTheme->DrawBackground(&param);
- if (!m_pProperties->m_pDataProvider)
- return;
-
CFWL_ThemeText textParam;
textParam.m_pWidget = this;
textParam.m_iPart = CFWL_Part::Caption;
@@ -157,15 +150,10 @@ void IFWL_CheckBox::Layout() {
FXSYS_round(m_pProperties->m_rtWidget.height);
GetClientRect(m_rtClient);
- if (!m_pProperties->m_pDataProvider)
- return;
-
FX_FLOAT fBoxTop = m_rtClient.top;
FX_FLOAT fClientBottom = m_rtClient.bottom();
- IFWL_CheckBox::DataProvider* pData =
- static_cast<IFWL_CheckBox::DataProvider*>(m_pProperties->m_pDataProvider);
- FX_FLOAT fCheckBox = pData->GetBoxSize(this);
+ FX_FLOAT fCheckBox = m_pDataProvider->GetBoxSize(this);
switch (m_pProperties->m_dwStyleExes & FWL_STYLEEXT_CKB_VLayoutMask) {
case FWL_STYLEEXT_CKB_Top:
break;
« no previous file with comments | « xfa/fwl/core/ifwl_checkbox.h ('k') | xfa/fwl/core/ifwl_combobox.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698