From 6312bf94bb44e2edeb855008da0921c13103f66a Mon Sep 17 00:00:00 2001 From: Henrique Nakashima Date: Wed, 2 May 2018 21:14:27 +0000 Subject: Use pointer instead of ref for XFA_RectWithoutMargin param. Removed many null checks since XFA_RectWithoutMargin already checks if the margin is null internally. Change-Id: I21f5101fe38559eb02f4c3aaf081ff29ce293e47 Reviewed-on: https://pdfium-review.googlesource.com/31993 Commit-Queue: Henrique Nakashima Commit-Queue: Ryan Harrison Reviewed-by: Ryan Harrison --- xfa/fxfa/cxfa_ffcheckbutton.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'xfa/fxfa/cxfa_ffcheckbutton.cpp') diff --git a/xfa/fxfa/cxfa_ffcheckbutton.cpp b/xfa/fxfa/cxfa_ffcheckbutton.cpp index f5f840847b..c78fa1336d 100644 --- a/xfa/fxfa/cxfa_ffcheckbutton.cpp +++ b/xfa/fxfa/cxfa_ffcheckbutton.cpp @@ -95,8 +95,7 @@ bool CXFA_FFCheckButton::PerformLayout() { float fCheckSize = m_pNode->GetCheckButtonSize(); CXFA_Margin* margin = m_pNode->GetMarginIfExists(); CFX_RectF rtWidget = GetRectWithoutRotate(); - if (margin) - XFA_RectWithoutMargin(rtWidget, margin); + XFA_RectWithoutMargin(&rtWidget, margin); XFA_AttributeEnum iCapPlacement = XFA_AttributeEnum::Unknown; float fCapReserve = 0; @@ -135,7 +134,7 @@ bool CXFA_FFCheckButton::PerformLayout() { } case XFA_AttributeEnum::Top: { m_rtCaption.height = fCapReserve; - XFA_RectWithoutMargin(m_rtCaption, captionMargin); + XFA_RectWithoutMargin(&m_rtCaption, captionMargin); m_rtUI.height -= fCapReserve; m_rtUI.top += fCapReserve; break; @@ -150,7 +149,7 @@ bool CXFA_FFCheckButton::PerformLayout() { case XFA_AttributeEnum::Bottom: { m_rtCaption.top = m_rtCaption.bottom() - fCapReserve; m_rtCaption.height = fCapReserve; - XFA_RectWithoutMargin(m_rtCaption, captionMargin); + XFA_RectWithoutMargin(&m_rtCaption, captionMargin); m_rtUI.height -= fCapReserve; break; } @@ -178,8 +177,7 @@ bool CXFA_FFCheckButton::PerformLayout() { CXFA_Border* borderUI = m_pNode->GetUIBorder(); if (borderUI) { CXFA_Margin* borderMargin = borderUI->GetMarginIfExists(); - if (borderMargin) - XFA_RectWithoutMargin(m_rtUI, borderMargin); + XFA_RectWithoutMargin(&m_rtUI, borderMargin); } m_rtUI.Normalize(); @@ -193,7 +191,7 @@ bool CXFA_FFCheckButton::PerformLayout() { void CXFA_FFCheckButton::CapLeftRightPlacement( const CXFA_Margin* captionMargin) { - XFA_RectWithoutMargin(m_rtCaption, captionMargin); + XFA_RectWithoutMargin(&m_rtCaption, captionMargin); if (m_rtCaption.height < 0) m_rtCaption.top += m_rtCaption.height; if (m_rtCaption.width < 0) { -- cgit v1.2.3