From 4572c8a20beee5cbab2eb1a90cb6cadcc5fa512c Mon Sep 17 00:00:00 2001 From: dsinclair Date: Mon, 21 Nov 2016 18:11:16 -0800 Subject: Remove the GetCaption dataprovider method 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 --- xfa/fwl/core/ifwl_pushbutton.cpp | 56 ---------------------------------------- 1 file changed, 56 deletions(-) (limited to 'xfa/fwl/core/ifwl_pushbutton.cpp') 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(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) -- cgit v1.2.3