summaryrefslogtreecommitdiff
path: root/xfa/fxfa/app/xfa_ffpushbutton.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-02-07 16:36:39 -0500
committerChromium commit bot <commit-bot@chromium.org>2017-02-08 01:36:02 +0000
commitbba2a7cf30da9e84bcc14ef32dbb0bb944229219 (patch)
tree94a74de8d07b3e395bf6e08a62811a3a0d652d19 /xfa/fxfa/app/xfa_ffpushbutton.cpp
parent55e026b7b6eec17b012c819c4a7d39e63094b5c4 (diff)
downloadpdfium-bba2a7cf30da9e84bcc14ef32dbb0bb944229219.tar.xz
Update to use CFX_Rect{F} and CFX_Matrix constructors.
This Cl updates the code to use the constructors instead of creating an empty object and calling Set(). It also removes the various memsets of the CFX_Rect{F} classes. Change-Id: I6e20cec00866a38372858dcba5a30d31103172e4 Reviewed-on: https://pdfium-review.googlesource.com/2550 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'xfa/fxfa/app/xfa_ffpushbutton.cpp')
-rw-r--r--xfa/fxfa/app/xfa_ffpushbutton.cpp25
1 files changed, 12 insertions, 13 deletions
diff --git a/xfa/fxfa/app/xfa_ffpushbutton.cpp b/xfa/fxfa/app/xfa_ffpushbutton.cpp
index 92e5b70d4e..fcb7d32761 100644
--- a/xfa/fxfa/app/xfa_ffpushbutton.cpp
+++ b/xfa/fxfa/app/xfa_ffpushbutton.cpp
@@ -45,8 +45,8 @@ void CXFA_FFPushButton::RenderWidget(CFX_Graphics* pGS,
RenderHighlightCaption(pGS, &mtRotate);
CFX_RectF rtWidget;
GetRectWithoutRotate(rtWidget);
- CFX_Matrix mt;
- mt.Set(1, 0, 0, 1, rtWidget.left, rtWidget.top);
+
+ CFX_Matrix mt(1, 0, 0, 1, rtWidget.left, rtWidget.top);
mt.Concat(mtRotate);
GetApp()->GetWidgetMgrDelegate()->OnDrawWidget(m_pNormalWidget, pGS, &mt);
}
@@ -102,20 +102,21 @@ bool CXFA_FFPushButton::PerformLayout() {
CXFA_FFWidget::PerformLayout();
CFX_RectF rtWidget;
GetRectWithoutRotate(rtWidget);
+
m_rtUI = rtWidget;
- if (CXFA_Margin mgWidget = m_pDataAcc->GetMargin()) {
+ if (CXFA_Margin mgWidget = m_pDataAcc->GetMargin())
XFA_RectWidthoutMargin(rtWidget, mgWidget);
- }
+
CXFA_Caption caption = m_pDataAcc->GetCaption();
- m_rtCaption.Set(rtWidget.left, rtWidget.top, rtWidget.width, rtWidget.height);
- if (CXFA_Margin mgCap = caption.GetMargin()) {
+ m_rtCaption = rtWidget;
+ if (CXFA_Margin mgCap = caption.GetMargin())
XFA_RectWidthoutMargin(m_rtCaption, mgCap);
- }
+
LayoutHighlightCaption();
SetFWLRect();
- if (m_pNormalWidget) {
+ if (m_pNormalWidget)
m_pNormalWidget->Update();
- }
+
return true;
}
FX_FLOAT CXFA_FFPushButton::GetLineWidth() {
@@ -176,8 +177,7 @@ void CXFA_FFPushButton::RenderHighlightCaption(CFX_Graphics* pGS,
GetRectWithoutRotate(rtWidget);
CFX_RectF rtClip = m_rtCaption;
rtClip.Intersect(rtWidget);
- CFX_Matrix mt;
- mt.Set(1, 0, 0, 1, m_rtCaption.left, m_rtCaption.top);
+ CFX_Matrix mt(1, 0, 0, 1, m_rtCaption.left, m_rtCaption.top);
if (pMatrix) {
pMatrix->TransformRect(rtClip);
mt.Concat(*pMatrix);
@@ -215,8 +215,7 @@ void CXFA_FFPushButton::OnDrawWidget(CFX_Graphics* pGraphics,
if (m_pNormalWidget->GetStylesEx() & XFA_FWL_PSBSTYLEEXT_HiliteInverted) {
if ((m_pNormalWidget->GetStates() & FWL_STATE_PSB_Pressed) &&
(m_pNormalWidget->GetStates() & FWL_STATE_PSB_Hovered)) {
- CFX_RectF rtFill = m_pNormalWidget->GetWidgetRect();
- rtFill.left = rtFill.top = 0;
+ CFX_RectF rtFill(0, 0, m_pNormalWidget->GetWidgetRect().Size());
FX_FLOAT fLineWith = GetLineWidth();
rtFill.Deflate(fLineWith, fLineWith);
CFX_Color cr(FXARGB_MAKE(128, 128, 255, 255));