summaryrefslogtreecommitdiff
path: root/xfa/fwl/core/ifwl_pushbutton.cpp
diff options
context:
space:
mode:
authordsinclair <dsinclair@chromium.org>2016-11-15 12:33:06 -0800
committerCommit bot <commit-bot@chromium.org>2016-11-15 12:33:06 -0800
commit38eaf4b11383e24a00192132b683cc07e38622a6 (patch)
tree169f9d48784035519ddee9191aa412cc817a4531 /xfa/fwl/core/ifwl_pushbutton.cpp
parent05b9a317d66c29f740e4b0e89ea87143a11d61fc (diff)
downloadpdfium-38eaf4b11383e24a00192132b683cc07e38622a6.tar.xz
Cleanup cfwl_* files.
This Cl cleans up the visibility, method usage and return values in the remaining CFWL files. Review-Url: https://codereview.chromium.org/2498163002
Diffstat (limited to 'xfa/fwl/core/ifwl_pushbutton.cpp')
-rw-r--r--xfa/fwl/core/ifwl_pushbutton.cpp150
1 files changed, 1 insertions, 149 deletions
diff --git a/xfa/fwl/core/ifwl_pushbutton.cpp b/xfa/fwl/core/ifwl_pushbutton.cpp
index 0b3b574743..03bc7060d7 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;
}
}