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

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

Issue 2498163002: Cleanup cfwl_* files. (Closed)
Patch Set: Review feedback 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') | no next file » | 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 0b3b574743d79c0f133c6b2d2e8a621082d11943..03bc7060d7d5d26cee39e3b576d73d94dc7a5be4 100644
--- a/xfa/fwl/core/ifwl_pushbutton.cpp
+++ b/xfa/fwl/core/ifwl_pushbutton.cpp
@@ -89,7 +89,6 @@ void IFWL_PushButton::DrawWidget(CFX_Graphics* pGraphics,
return;
IFWL_PushButtonDP* pData =
static_cast<IFWL_PushButtonDP*>(m_pProperties->m_pDataProvider);
- CFX_DIBitmap* pPicture = nullptr;
IFWL_ThemeProvider* pTheme = m_pProperties->m_pThemeProvider;
if (HasBorder()) {
DrawBorder(pGraphics, CFWL_Part::Border, m_pProperties->m_pThemeProvider,
@@ -102,8 +101,7 @@ void IFWL_PushButton::DrawWidget(CFX_Graphics* pGraphics,
DrawBkground(pGraphics, m_pProperties->m_pThemeProvider, pMatrix);
CFX_Matrix matrix;
matrix.Concat(*pMatrix);
- FX_FLOAT iPicwidth = 0;
- FX_FLOAT ipicheight = 0;
+
CFX_WideString wsCaption;
if (pData) {
pData->GetCaption(this, wsCaption);
@@ -118,153 +116,7 @@ void IFWL_PushButton::DrawWidget(CFX_Graphics* pGraphics,
DrawText(pGraphics, m_pProperties->m_pThemeProvider, &matrix);
break;
case FWL_STYLEEXT_PSB_IconOnly:
- if (pData) {
- pPicture = pData->GetPicture(this);
- }
- if (pPicture) {
- CFX_PointF point;
- switch (m_iTTOAlign) {
- case 0: {
- point.x = m_rtClient.left;
- point.y = m_rtClient.top;
- break;
- }
- case 1: {
- point.x = m_rtClient.left +
- (m_rtClient.width / 2 - pPicture->GetWidth() / 2);
- point.y = m_rtClient.top;
- break;
- }
- case 2:
- point.x = m_rtClient.left + m_rtClient.width - pPicture->GetWidth();
- point.y = m_rtClient.top;
- break;
- case 4:
- point.x = m_rtClient.left;
- point.y = m_rtClient.top + m_rtClient.height / 2 -
- pPicture->GetHeight() / 2;
- break;
- case 5:
- point.x = m_rtClient.left +
- (m_rtClient.width / 2 - pPicture->GetWidth() / 2);
- point.y = m_rtClient.top + m_rtClient.height / 2 -
- pPicture->GetHeight() / 2;
- break;
- case 6:
- point.x = m_rtClient.left + m_rtClient.width - pPicture->GetWidth();
- point.y = m_rtClient.top + m_rtClient.height / 2 -
- pPicture->GetHeight() / 2;
- break;
- case 8:
- point.x = m_rtClient.left;
- point.y =
- m_rtClient.top + m_rtClient.height - pPicture->GetHeight();
- break;
- case 9:
- point.x = m_rtClient.left +
- (m_rtClient.width / 2 - pPicture->GetWidth() / 2);
- point.y =
- m_rtClient.top + m_rtClient.height - pPicture->GetHeight();
- break;
- case 10:
- point.x = m_rtClient.left + m_rtClient.width - pPicture->GetWidth();
- point.y =
- m_rtClient.top + m_rtClient.height - pPicture->GetHeight();
- break;
- }
- pGraphics->DrawImage(pPicture, point, &matrix);
- }
- break;
case FWL_STYLEEXT_PSB_TextIcon:
- if (pPicture) {
- CFX_PointF point;
- switch (m_iTTOAlign) {
- case 0: {
- point.x = m_rtClient.left;
- point.y = m_rtClient.top;
- iPicwidth = (FX_FLOAT)(pPicture->GetWidth() - 7);
- ipicheight =
- pPicture->GetHeight() / 2 - m_rtCaption.top - rtText.height / 2;
- break;
- }
- case 1: {
- point.x =
- m_rtClient.left + (m_rtClient.width / 2 -
- (pPicture->GetWidth() + rtText.width) / 2);
- point.y = m_rtClient.top;
- iPicwidth = pPicture->GetWidth() -
- ((m_rtClient.width) / 2 - rtText.width / 2 - point.x) +
- rtText.width / 2 - 7;
- ipicheight =
- pPicture->GetHeight() / 2 - m_rtCaption.top - rtText.height / 2;
- break;
- }
- case 2:
- point.x = m_rtClient.left + m_rtClient.width -
- pPicture->GetWidth() - rtText.width;
- point.y = m_rtClient.top;
- iPicwidth = m_rtClient.left + m_rtClient.width - point.x -
- pPicture->GetWidth() - rtText.width + 7;
- ipicheight =
- pPicture->GetHeight() / 2 - m_rtCaption.top - rtText.height / 2;
- break;
- case 4:
- point.x = m_rtClient.left;
- point.y = m_rtClient.top + m_rtClient.height / 2 -
- pPicture->GetHeight() / 2;
- iPicwidth = m_rtClient.left + pPicture->GetWidth() - 7;
- break;
- case 5:
- point.x =
- m_rtClient.left + (m_rtClient.width / 2 -
- (pPicture->GetWidth() + rtText.width) / 2);
- point.y = m_rtClient.top + m_rtClient.height / 2 -
- pPicture->GetHeight() / 2;
- iPicwidth = pPicture->GetWidth() -
- ((m_rtClient.width) / 2 - rtText.width / 2 - point.x) +
- rtText.width / 2 - 7;
- break;
- case 6:
- point.x = m_rtClient.left + m_rtClient.width -
- pPicture->GetWidth() - rtText.width;
- point.y = m_rtClient.top + m_rtClient.height / 2 -
- pPicture->GetHeight() / 2;
- iPicwidth = m_rtClient.left + m_rtClient.width - point.x -
- pPicture->GetWidth() - rtText.width + 7;
- break;
- case 8:
- point.x = m_rtClient.left;
- point.y =
- m_rtClient.top + m_rtClient.height - pPicture->GetHeight();
- iPicwidth = (FX_FLOAT)(pPicture->GetWidth() - 7);
- ipicheight -= rtText.height / 2;
- break;
- case 9:
- point.x =
- m_rtClient.left + (m_rtClient.width / 2 -
- (pPicture->GetWidth() + rtText.width) / 2);
- point.y =
- m_rtClient.top + m_rtClient.height - pPicture->GetHeight();
- iPicwidth = pPicture->GetWidth() -
- ((m_rtClient.width) / 2 - rtText.width / 2 - point.x) +
- rtText.width / 2 - 7;
- ipicheight -= rtText.height / 2;
- break;
- case 10:
- point.x = m_rtClient.left + m_rtClient.width -
- pPicture->GetWidth() - rtText.width;
- point.y =
- m_rtClient.top + m_rtClient.height - pPicture->GetHeight();
- iPicwidth = m_rtClient.left + m_rtClient.width - point.x -
- pPicture->GetWidth() - rtText.width + 7;
- ipicheight -= rtText.height / 2;
- break;
- }
- pGraphics->DrawImage(pPicture, point, &matrix);
- }
- matrix.e += m_rtClient.left + iPicwidth;
- matrix.f += m_rtClient.top + ipicheight;
- DrawText(pGraphics, m_pProperties->m_pThemeProvider, &matrix);
break;
}
}
« no previous file with comments | « xfa/fwl/core/ifwl_pushbutton.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698