From c222907f453e8a0e6376a86f89354eedb8285854 Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Tue, 7 Feb 2017 09:04:28 -0500 Subject: Cleanup out params in XFA layout code. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This CL converts some of the out parameters in the XFA layout code to pointers instead of references. Change-Id: I6246b91b975e7bc08f8cfb040de9dfdc3c3bedee Reviewed-on: https://pdfium-review.googlesource.com/2531 Commit-Queue: dsinclair Reviewed-by: Nicolás Peña --- xfa/fxfa/parser/cxfa_layoutitem.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'xfa/fxfa/parser/cxfa_layoutitem.cpp') diff --git a/xfa/fxfa/parser/cxfa_layoutitem.cpp b/xfa/fxfa/parser/cxfa_layoutitem.cpp index 55aa285e2d..7a373e1e9a 100644 --- a/xfa/fxfa/parser/cxfa_layoutitem.cpp +++ b/xfa/fxfa/parser/cxfa_layoutitem.cpp @@ -61,16 +61,16 @@ CXFA_ContainerLayoutItem* CXFA_LayoutItem::GetPage() const { return nullptr; } -void CXFA_LayoutItem::GetRect(CFX_RectF& rtLayout, bool bRelative) const { +CFX_RectF CXFA_LayoutItem::GetRect(bool bRelative) const { ASSERT(m_bIsContentLayoutItem); - const CXFA_ContentLayoutItem* pThis = - static_cast(this); + auto pThis = static_cast(this); CFX_PointF sPos = pThis->m_sPos; CFX_SizeF sSize = pThis->m_sSize; if (bRelative) { + CFX_RectF rtLayout; rtLayout.Set(sPos.x, sPos.y, sSize.x, sSize.y); - return; + return rtLayout; } for (CXFA_LayoutItem* pLayoutItem = pThis->m_pParent; pLayoutItem; @@ -100,7 +100,9 @@ void CXFA_LayoutItem::GetRect(CFX_RectF& rtLayout, bool bRelative) const { break; } + CFX_RectF rtLayout; rtLayout.Set(sPos.x, sPos.y, sSize.x, sSize.y); + return rtLayout; } CXFA_LayoutItem* CXFA_LayoutItem::GetFirst() { -- cgit v1.2.3