diff options
author | dsinclair <dsinclair@chromium.org> | 2016-12-07 18:47:00 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-12-07 18:47:00 -0800 |
commit | da911bc12558667555266425d0b7e83296e8cc7d (patch) | |
tree | d0e0e84597e30f2d59856a9a55b737f49faa9522 /xfa/fwl/core/cfwl_widget.cpp | |
parent | 67c6ca3cd86b6a31c888264bb8067c6c4324e56c (diff) | |
download | pdfium-da911bc12558667555266425d0b7e83296e8cc7d.tar.xz |
Convert GetWidgetRect to return rect.
Current GetWidgetRect accepts the rect as an out-param. This CL converts the
code to return the rect instead.
Review-Url: https://codereview.chromium.org/2556873004
Diffstat (limited to 'xfa/fwl/core/cfwl_widget.cpp')
-rw-r--r-- | xfa/fwl/core/cfwl_widget.cpp | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/xfa/fwl/core/cfwl_widget.cpp b/xfa/fwl/core/cfwl_widget.cpp index 80ff57ce13..225721be43 100644 --- a/xfa/fwl/core/cfwl_widget.cpp +++ b/xfa/fwl/core/cfwl_widget.cpp @@ -65,12 +65,12 @@ bool CFWL_Widget::IsInstance(const CFX_WideStringC& wsClass) const { return false; } -void CFWL_Widget::GetWidgetRect(CFX_RectF& rect, bool bAutoSize) { - if (!bAutoSize) { - rect = m_pProperties->m_rtWidget; - return; - } - InflateWidgetRect(rect); +CFX_RectF CFWL_Widget::GetAutosizedWidgetRect() { + return CFX_RectF(); +} + +CFX_RectF CFWL_Widget::GetWidgetRect() { + return m_pProperties->m_rtWidget; } void CFWL_Widget::InflateWidgetRect(CFX_RectF& rect) { @@ -201,7 +201,7 @@ void CFWL_Widget::TransformTo(CFWL_Widget* pWidget, CFX_Matrix m; CFWL_Widget* parent = GetParent(); if (parent) { - GetWidgetRect(r, false); + r = GetWidgetRect(); fx += r.left; fy += r.top; GetMatrix(m, true); @@ -210,8 +210,9 @@ void CFWL_Widget::TransformTo(CFWL_Widget* pWidget, CFWL_Widget* form1 = m_pWidgetMgr->GetSystemFormWidget(this); if (!form1) return; + if (!pWidget) { - form1->GetWidgetRect(r, false); + r = form1->GetWidgetRect(); fx += r.left; fy += r.top; return; @@ -220,10 +221,10 @@ void CFWL_Widget::TransformTo(CFWL_Widget* pWidget, if (!form2) return; if (form1 != form2) { - form1->GetWidgetRect(r, false); + r = form1->GetWidgetRect(); fx += r.left; fy += r.top; - form2->GetWidgetRect(r, false); + r = form2->GetWidgetRect(); fx -= r.left; fy -= r.top; } @@ -234,7 +235,7 @@ void CFWL_Widget::TransformTo(CFWL_Widget* pWidget, m1.SetIdentity(); m1.SetReverse(m); m1.TransformPoint(fx, fy); - pWidget->GetWidgetRect(r, false); + r = pWidget->GetWidgetRect(); fx -= r.left; fy -= r.top; } @@ -261,7 +262,7 @@ void CFWL_Widget::GetMatrix(CFX_Matrix& matrix, bool bGlobal) { for (int32_t i = count - 2; i >= 0; i--) { parent = parents.GetAt(i); parent->GetMatrix(ctmOnParent, false); - parent->GetWidgetRect(rect, false); + rect = parent->GetWidgetRect(); matrix.Concat(ctmOnParent, true); matrix.Translate(rect.left, rect.top, true); } @@ -686,8 +687,7 @@ CFX_SizeF CFWL_Widget::GetOffsetFromParent(CFWL_Widget* pParent) { CFWL_Widget* pDstWidget = GetParent(); while (pDstWidget && pDstWidget != pParent) { - CFX_RectF rtDst; - pDstWidget->GetWidgetRect(rtDst, false); + CFX_RectF rtDst = pDstWidget->GetWidgetRect(); szRet += CFX_SizeF(rtDst.left, rtDst.top); pDstWidget = pWidgetMgr->GetParentWidget(pDstWidget); } |