Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1449)

Unified Diff: xfa/fwl/core/ifwl_pushbutton.cpp

Issue 2522663002: Remove the GetCaption dataprovider method (Closed)
Patch Set: Remove tooltip Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « xfa/fwl/core/ifwl_pushbutton.h ('k') | xfa/fwl/core/ifwl_tooltip.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/fwl/core/ifwl_pushbutton.cpp
diff --git a/xfa/fwl/core/ifwl_pushbutton.cpp b/xfa/fwl/core/ifwl_pushbutton.cpp
index 8ee0485b11e35441561657a8b6e0787c3dc2de79..9589de1c3cad00aff5c727398aba65f9443ad83b 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(&param);
}
-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(&param);
-}
-
uint32_t IFWL_PushButton::GetPartStates() {
uint32_t dwStates = CFWL_PartState_Normal;
if (m_pProperties->m_dwStates & FWL_WGTSTATE_Focused)
« no previous file with comments | « xfa/fwl/core/ifwl_pushbutton.h ('k') | xfa/fwl/core/ifwl_tooltip.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698