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_ffwidget.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'xfa/fxfa/cxfa_ffwidget.cpp') diff --git a/xfa/fxfa/cxfa_ffwidget.cpp b/xfa/fxfa/cxfa_ffwidget.cpp index 96c611e3f7..8b2e826165 100644 --- a/xfa/fxfa/cxfa_ffwidget.cpp +++ b/xfa/fxfa/cxfa_ffwidget.cpp @@ -209,12 +209,12 @@ RetainPtr XFA_LoadImageFromBuffer( return pBitmap; } -void XFA_RectWithoutMargin(CFX_RectF& rt, const CXFA_Margin* margin, bool bUI) { +void XFA_RectWithoutMargin(CFX_RectF* rt, const CXFA_Margin* margin) { if (!margin) return; - rt.Deflate(margin->GetLeftInset(), margin->GetTopInset(), - margin->GetRightInset(), margin->GetBottomInset()); + rt->Deflate(margin->GetLeftInset(), margin->GetTopInset(), + margin->GetRightInset(), margin->GetBottomInset()); } CXFA_FFWidget* XFA_GetWidgetFromLayoutItem(CXFA_LayoutItem* pLayoutItem) { @@ -298,8 +298,7 @@ void CXFA_FFWidget::RenderWidget(CXFA_Graphics* pGS, CFX_RectF rtBorder = GetRectWithoutRotate(); CXFA_Margin* margin = border->GetMarginIfExists(); - if (margin) - XFA_RectWithoutMargin(rtBorder, margin); + XFA_RectWithoutMargin(&rtBorder, margin); rtBorder.Normalize(); DrawBorder(pGS, border, rtBorder, matrix); -- cgit v1.2.3