summaryrefslogtreecommitdiff
path: root/xfa/fwl/core/ifwl_checkbox.cpp
diff options
context:
space:
mode:
authordsinclair <dsinclair@chromium.org>2016-11-23 10:49:33 -0800
committerCommit bot <commit-bot@chromium.org>2016-11-23 10:49:33 -0800
commit7c47e1d3172ce6f625b93be50aac2ebf86a45d0c (patch)
treebb7beae7637635cd0c631f015411a63fd2892486 /xfa/fwl/core/ifwl_checkbox.cpp
parent7172b71a005c181e9f103ac0e19f6675bf3bc8e8 (diff)
downloadpdfium-7c47e1d3172ce6f625b93be50aac2ebf86a45d0c.tar.xz
Remove DataProvider from CFWL_WidgetPropertieschromium/2931chromium/2930
This CL removes the generic DataProvider code from CFWL_WidgetProperties and adds the specific providers to the two classes that require them. Review-Url: https://codereview.chromium.org/2527683002
Diffstat (limited to 'xfa/fwl/core/ifwl_checkbox.cpp')
-rw-r--r--xfa/fwl/core/ifwl_checkbox.cpp16
1 files changed, 2 insertions, 14 deletions
diff --git a/xfa/fwl/core/ifwl_checkbox.cpp b/xfa/fwl/core/ifwl_checkbox.cpp
index 5268aceee7..b33eaa6559 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;