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_widgetmgr.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_widgetmgr.cpp')
-rw-r--r-- | xfa/fwl/core/cfwl_widgetmgr.cpp | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/xfa/fwl/core/cfwl_widgetmgr.cpp b/xfa/fwl/core/cfwl_widgetmgr.cpp index 1649ee76b9..5bcef7b7df 100644 --- a/xfa/fwl/core/cfwl_widgetmgr.cpp +++ b/xfa/fwl/core/cfwl_widgetmgr.cpp @@ -157,8 +157,7 @@ void CFWL_WidgetMgr::RepaintWidget(CFWL_Widget* pWidget, if (IsFormDisabled()) { CFWL_Widget* pOuter = pWidget->GetOuter(); while (pOuter) { - CFX_RectF rtTemp; - pNative->GetWidgetRect(rtTemp, false); + CFX_RectF rtTemp = pNative->GetWidgetRect(); rect.left += rtTemp.left; rect.top += rtTemp.top; pNative = pOuter; @@ -304,8 +303,7 @@ CFWL_Widget* CFWL_WidgetMgr::GetWidgetAtPoint(CFWL_Widget* parent, m.SetIdentity(); m.SetReverse(matrixOnParent); m.TransformPoint(x1, y1); - CFX_RectF bounds; - child->GetWidgetRect(bounds, false); + CFX_RectF bounds = child->GetWidgetRect(); if (bounds.Contains(x1, y1)) { x1 -= bounds.left; y1 -= bounds.top; @@ -473,8 +471,7 @@ void CFWL_WidgetMgr::OnDrawWidget(CFWL_Widget* pWidget, return; CFX_Graphics* pTemp = DrawWidgetBefore(pWidget, pGraphics, pMatrix); - CFX_RectF clipCopy; - pWidget->GetWidgetRect(clipCopy, false); + CFX_RectF clipCopy = pWidget->GetWidgetRect(); clipCopy.left = clipCopy.top = 0; if (UseOffscreenDirect(pWidget)) { @@ -527,8 +524,7 @@ void CFWL_WidgetMgr::DrawChild(CFWL_Widget* parent, if (child->GetStates() & FWL_WGTSTATE_Invisible) continue; - CFX_RectF rtWidget; - child->GetWidgetRect(rtWidget, false); + CFX_RectF rtWidget = child->GetWidgetRect(); if (rtWidget.IsEmpty()) continue; @@ -572,8 +568,7 @@ CFX_Graphics* CFWL_WidgetMgr::DrawWidgetBefore(CFWL_Widget* pWidget, Item* pItem = GetWidgetMgrItem(pWidget); if (!pItem->pOffscreen) { pItem->pOffscreen.reset(new CFX_Graphics); - CFX_RectF rect; - pWidget->GetWidgetRect(rect, false); + CFX_RectF rect = pWidget->GetWidgetRect(); pItem->pOffscreen->Create((int32_t)rect.width, (int32_t)rect.height, FXDIB_Argb); } @@ -608,8 +603,7 @@ bool CFWL_WidgetMgr::IsNeedRepaint(CFWL_Widget* pWidget, return true; } - CFX_RectF rtWidget; - pWidget->GetWidgetRect(rtWidget, false); + CFX_RectF rtWidget = pWidget->GetWidgetRect(); rtWidget.left = rtWidget.top = 0; pMatrix->TransformRect(rtWidget); if (!rtWidget.IntersectWith(rtDirty)) @@ -645,8 +639,7 @@ bool CFWL_WidgetMgr::IsNeedRepaint(CFWL_Widget* pWidget, hitPoint[10].hitPoint.y = hitPoint[11].hitPoint.y = rtWidget.height + rtWidget.top; do { - CFX_RectF rect; - pChild->GetWidgetRect(rect, false); + CFX_RectF rect = pChild->GetWidgetRect(); CFX_RectF r = rect; r.left += rtWidget.left; r.top += rtWidget.top; @@ -706,8 +699,7 @@ bool CFWL_WidgetMgr::UseOffscreenDirect(CFWL_Widget* pWidget) const { #if (_FX_OS_ == _FX_WIN32_DESKTOP_) || (_FX_OS_ == _FX_WIN64_) if (pItem->bOutsideChanged) { - CFX_RectF r; - pWidget->GetWidgetRect(r, false); + CFX_RectF r = pWidget->GetWidgetRect(); CFX_RectF temp(m_rtScreen); temp.Deflate(50, 50); if (!temp.Contains(r)) |