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/app/xfa_fffield.cpp | 7 +++---- xfa/fxfa/app/xfa_ffnotify.cpp | 2 +- xfa/fxfa/app/xfa_fftext.cpp | 3 +-- xfa/fxfa/app/xfa_ffwidget.cpp | 12 +++++------- 4 files changed, 10 insertions(+), 14 deletions(-) (limited to 'xfa/fxfa/app') diff --git a/xfa/fxfa/app/xfa_fffield.cpp b/xfa/fxfa/app/xfa_fffield.cpp index a8ee0b9acc..c053a8c6ca 100644 --- a/xfa/fxfa/app/xfa_fffield.cpp +++ b/xfa/fxfa/app/xfa_fffield.cpp @@ -30,6 +30,7 @@ CXFA_FFField::CXFA_FFField(CXFA_WidgetAcc* pDataAcc) m_rtUI.Set(0, 0, 0, 0); m_rtCaption.Set(0, 0, 0, 0); } + CXFA_FFField::~CXFA_FFField() { CXFA_FFField::UnloadWidget(); } @@ -196,12 +197,10 @@ void CXFA_FFField::CapPlacement() { rtWidget.height); } else { pItem = pItem->GetFirst(); - pItem->GetRect(m_rtCaption); + m_rtCaption = pItem->GetRect(false); pItem = pItem->GetNext(); while (pItem) { - CFX_RectF rtRect; - pItem->GetRect(rtRect); - m_rtCaption.height += rtRect.Height(); + m_rtCaption.height += pItem->GetRect(false).Height(); pItem = pItem->GetNext(); } XFA_RectWidthoutMargin(m_rtCaption, mgWidget); diff --git a/xfa/fxfa/app/xfa_ffnotify.cpp b/xfa/fxfa/app/xfa_ffnotify.cpp index d84ac0de37..0ea7a9c4e1 100644 --- a/xfa/fxfa/app/xfa_ffnotify.cpp +++ b/xfa/fxfa/app/xfa_ffnotify.cpp @@ -489,7 +489,7 @@ void CXFA_FFNotify::OnLayoutItemAdded(CXFA_LayoutProcessor* pLayout, if (pWidget->IsLoaded()) { CFX_RectF rtOld; pWidget->GetWidgetRect(rtOld); - if (rtOld != pWidget->ReCacheWidgetRect()) + if (rtOld != pWidget->RecacheWidgetRect()) pWidget->PerformLayout(); } else { pWidget->LoadWidget(); diff --git a/xfa/fxfa/app/xfa_fftext.cpp b/xfa/fxfa/app/xfa_fftext.cpp index 0cc6651d21..b87645d8a7 100644 --- a/xfa/fxfa/app/xfa_fftext.cpp +++ b/xfa/fxfa/app/xfa_fftext.cpp @@ -86,8 +86,7 @@ bool CXFA_FFText::PerformLayout() { } pItem = pItem->GetFirst(); while (pItem) { - CFX_RectF rtText; - pItem->GetRect(rtText); + CFX_RectF rtText = pItem->GetRect(false); if (CXFA_Margin mgWidget = m_pDataAcc->GetMargin()) { if (!pItem->GetPrev()) { FX_FLOAT fTopInset; diff --git a/xfa/fxfa/app/xfa_ffwidget.cpp b/xfa/fxfa/app/xfa_ffwidget.cpp index 29b10dd195..95cfe2e59f 100644 --- a/xfa/fxfa/app/xfa_ffwidget.cpp +++ b/xfa/fxfa/app/xfa_ffwidget.cpp @@ -46,15 +46,13 @@ const CFWL_App* CXFA_FFWidget::GetFWLApp() { } void CXFA_FFWidget::GetWidgetRect(CFX_RectF& rtWidget) { - if ((m_dwStatus & XFA_WidgetStatus_RectCached) == 0) { - m_dwStatus |= XFA_WidgetStatus_RectCached; - GetRect(m_rtWidget); - } + if ((m_dwStatus & XFA_WidgetStatus_RectCached) == 0) + RecacheWidgetRect(); rtWidget = m_rtWidget; } -CFX_RectF CXFA_FFWidget::ReCacheWidgetRect() { +CFX_RectF CXFA_FFWidget::RecacheWidgetRect() { m_dwStatus |= XFA_WidgetStatus_RectCached; - GetRect(m_rtWidget); + m_rtWidget = GetRect(false); return m_rtWidget; } void CXFA_FFWidget::GetRectWithoutRotate(CFX_RectF& rtWidget) { @@ -136,7 +134,7 @@ bool CXFA_FFWidget::LoadWidget() { } void CXFA_FFWidget::UnloadWidget() {} bool CXFA_FFWidget::PerformLayout() { - ReCacheWidgetRect(); + RecacheWidgetRect(); return true; } bool CXFA_FFWidget::UpdateFWLData() { -- cgit v1.2.3