diff options
author | dsinclair <dsinclair@chromium.org> | 2016-11-21 18:11:16 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-11-21 18:11:17 -0800 |
commit | 4572c8a20beee5cbab2eb1a90cb6cadcc5fa512c (patch) | |
tree | 3efd738042096ce5c4895f55a7e71065210a9a06 /xfa/fwl/core/ifwl_pushbutton.cpp | |
parent | 4bd717ba4e40d4d3775c5e19334f4733fca8cb42 (diff) | |
download | pdfium-4572c8a20beee5cbab2eb1a90cb6cadcc5fa512c.tar.xz |
Remove the GetCaption dataprovider methodchromium/2928
This method mostly returns L"". In the one case where it returns
something different the value is substituted into the callsite.
The IFWL_Tooltip class was using the caption, but it is not currently
being used. Removed as well.
Review-Url: https://codereview.chromium.org/2522663002
Diffstat (limited to 'xfa/fwl/core/ifwl_pushbutton.cpp')
-rw-r--r-- | xfa/fwl/core/ifwl_pushbutton.cpp | 56 |
1 files changed, 0 insertions, 56 deletions
diff --git a/xfa/fwl/core/ifwl_pushbutton.cpp b/xfa/fwl/core/ifwl_pushbutton.cpp index 8ee0485b11..9589de1c3c 100644 --- a/xfa/fwl/core/ifwl_pushbutton.cpp +++ b/xfa/fwl/core/ifwl_pushbutton.cpp @@ -47,16 +47,6 @@ void IFWL_PushButton::GetWidgetRect(CFX_RectF& rect, bool bAutoSize) { if (!m_pProperties->m_pThemeProvider) m_pProperties->m_pThemeProvider = GetAvailableTheme(); - CFX_WideString wsCaption; - if (m_pProperties->m_pDataProvider) - m_pProperties->m_pDataProvider->GetCaption(this, wsCaption); - - int32_t iLen = wsCaption.GetLength(); - if (iLen > 0) { - CFX_SizeF sz = CalcTextSize(wsCaption, m_pProperties->m_pThemeProvider); - rect.Set(0, 0, sz.x, sz.y); - } - FX_FLOAT* fcaption = static_cast<FX_FLOAT*>(GetThemeCapacity(CFWL_WidgetCapacity::Margin)); rect.Inflate(*fcaption, *fcaption); @@ -92,7 +82,6 @@ void IFWL_PushButton::DrawWidget(CFX_Graphics* pGraphics, if (!m_pProperties->m_pThemeProvider) return; - IFWL_ThemeProvider* pTheme = m_pProperties->m_pThemeProvider; if (HasBorder()) { DrawBorder(pGraphics, CFWL_Part::Border, m_pProperties->m_pThemeProvider, pMatrix); @@ -102,26 +91,6 @@ void IFWL_PushButton::DrawWidget(CFX_Graphics* pGraphics, pMatrix); } DrawBkground(pGraphics, m_pProperties->m_pThemeProvider, pMatrix); - CFX_Matrix matrix; - matrix.Concat(*pMatrix); - - CFX_WideString wsCaption; - if (m_pProperties->m_pDataProvider) - m_pProperties->m_pDataProvider->GetCaption(this, wsCaption); - - CFX_RectF rtText; - rtText.Set(0, 0, 0, 0); - if (!wsCaption.IsEmpty()) - CalcTextRect(wsCaption, pTheme, 0, m_iTTOAlign, rtText); - - switch (m_pProperties->m_dwStyleExes & FWL_STYLEEXT_PSB_ModeMask) { - case FWL_STYLEEXT_PSB_TextOnly: - DrawText(pGraphics, m_pProperties->m_pThemeProvider, &matrix); - break; - case FWL_STYLEEXT_PSB_IconOnly: - case FWL_STYLEEXT_PSB_TextIcon: - break; - } } void IFWL_PushButton::DrawBkground(CFX_Graphics* pGraphics, @@ -140,31 +109,6 @@ void IFWL_PushButton::DrawBkground(CFX_Graphics* pGraphics, pTheme->DrawBackground(¶m); } -void IFWL_PushButton::DrawText(CFX_Graphics* pGraphics, - IFWL_ThemeProvider* pTheme, - const CFX_Matrix* pMatrix) { - if (!m_pProperties->m_pDataProvider) - return; - - CFX_WideString wsCaption; - m_pProperties->m_pDataProvider->GetCaption(this, wsCaption); - if (wsCaption.IsEmpty()) - return; - - CFWL_ThemeText param; - param.m_pWidget = this; - param.m_iPart = CFWL_Part::Caption; - param.m_dwStates = GetPartStates(); - param.m_pGraphics = pGraphics; - if (pMatrix) - param.m_matrix.Concat(*pMatrix); - param.m_rtPart = m_rtCaption; - param.m_wsText = wsCaption; - param.m_dwTTOStyles = m_dwTTOStyles; - param.m_iTTOAlign = m_iTTOAlign; - pTheme->DrawText(¶m); -} - uint32_t IFWL_PushButton::GetPartStates() { uint32_t dwStates = CFWL_PartState_Normal; if (m_pProperties->m_dwStates & FWL_WGTSTATE_Focused) |