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_checkbox.cpp | 28 ++++++---------------------- 1 file changed, 6 insertions(+), 22 deletions(-) (limited to 'xfa/fwl/core/ifwl_checkbox.cpp') diff --git a/xfa/fwl/core/ifwl_checkbox.cpp b/xfa/fwl/core/ifwl_checkbox.cpp index 04f367f772..4af7cc78fa 100644 --- a/xfa/fwl/core/ifwl_checkbox.cpp +++ b/xfa/fwl/core/ifwl_checkbox.cpp @@ -60,14 +60,10 @@ void IFWL_CheckBox::GetWidgetRect(CFX_RectF& rect, bool bAutoSize) { if (!m_pProperties->m_pDataProvider) return; - CFX_WideString wsCaption; - m_pProperties->m_pDataProvider->GetCaption(this, wsCaption); - if (wsCaption.GetLength() > 0) { - CFX_SizeF sz = CalcTextSize( - wsCaption, m_pProperties->m_pThemeProvider, - !!(m_pProperties->m_dwStyleExes & FWL_STYLEEXT_CKB_MultiLine)); - rect.Set(0, 0, sz.x, sz.y); - } + CFX_SizeF sz = CalcTextSize( + L"Check box", m_pProperties->m_pThemeProvider, + !!(m_pProperties->m_dwStyleExes & FWL_STYLEEXT_CKB_MultiLine)); + rect.Set(0, 0, sz.x, sz.y); rect.Inflate(kCaptionMargin, kCaptionMargin); IFWL_CheckBox::DataProvider* pData = @@ -124,11 +120,6 @@ void IFWL_CheckBox::DrawWidget(CFX_Graphics* pGraphics, if (!m_pProperties->m_pDataProvider) return; - CFX_WideString wsCaption; - m_pProperties->m_pDataProvider->GetCaption(this, wsCaption); - if (wsCaption.GetLength() <= 0) - return; - CFWL_ThemeText textParam; textParam.m_pWidget = this; textParam.m_iPart = CFWL_Part::Caption; @@ -137,7 +128,7 @@ void IFWL_CheckBox::DrawWidget(CFX_Graphics* pGraphics, if (pMatrix) textParam.m_matrix.Concat(*pMatrix); textParam.m_rtPart = m_rtCaption; - textParam.m_wsText = wsCaption; + textParam.m_wsText = L"Check box"; textParam.m_dwTTOStyles = m_dwTTOStyles; textParam.m_iTTOAlign = m_iTTOAlign; pTheme->DrawText(&textParam); @@ -211,14 +202,7 @@ void IFWL_CheckBox::Layout() { rtFocus.Set(m_rtCaption.left, m_rtCaption.top, m_rtCaption.width, m_rtCaption.height); - CFX_WideString wsCaption; - m_pProperties->m_pDataProvider->GetCaption(this, wsCaption); - if (wsCaption.IsEmpty()) { - m_rtFocus.Set(0, 0, 0, 0); - return; - } - - CalcTextRect(wsCaption, m_pProperties->m_pThemeProvider, m_dwTTOStyles, + CalcTextRect(L"Check box", m_pProperties->m_pThemeProvider, m_dwTTOStyles, m_iTTOAlign, rtFocus); if ((m_pProperties->m_dwStyleExes & FWL_STYLEEXT_CKB_MultiLine) == 0) { FX_FLOAT fWidth = std::max(m_rtCaption.width, rtFocus.width); -- cgit v1.2.3