summaryrefslogtreecommitdiff
path: root/xfa/fwl/core/ifwl_checkbox.cpp
diff options
context:
space:
mode:
authordsinclair <dsinclair@chromium.org>2016-11-21 18:11:16 -0800
committerCommit bot <commit-bot@chromium.org>2016-11-21 18:11:17 -0800
commit4572c8a20beee5cbab2eb1a90cb6cadcc5fa512c (patch)
tree3efd738042096ce5c4895f55a7e71065210a9a06 /xfa/fwl/core/ifwl_checkbox.cpp
parent4bd717ba4e40d4d3775c5e19334f4733fca8cb42 (diff)
downloadpdfium-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_checkbox.cpp')
-rw-r--r--xfa/fwl/core/ifwl_checkbox.cpp28
1 files changed, 6 insertions, 22 deletions
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);