diff options
author | dsinclair <dsinclair@chromium.org> | 2016-12-08 14:05:14 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-12-08 14:05:14 -0800 |
commit | 43ac44cbf52076fd2354d5276c95d5b4b4a06d64 (patch) | |
tree | 28670fc2d1ee83358c717fb43ca7bc9301b2480f /xfa/fwl/cfwl_widgetmgr.cpp | |
parent | 53ed03d9d865c312fdaa4434b83ed60619881226 (diff) | |
download | pdfium-43ac44cbf52076fd2354d5276c95d5b4b4a06d64.tar.xz |
Cleanup CFWL_Widget code to return CFX_RectFs where appropriate
This Cl changes the various Get*Rect methods in CFWL_Widget to return CFX_RectF
classes instead of taking an out parameter. The Repaint method is split into
Repaint() and RepaintRect() in order to change the param to a const CFX_RectF&
from a CFX_RectF*.
Review-Url: https://codereview.chromium.org/2560873005
Diffstat (limited to 'xfa/fwl/cfwl_widgetmgr.cpp')
-rw-r--r-- | xfa/fwl/cfwl_widgetmgr.cpp | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/xfa/fwl/cfwl_widgetmgr.cpp b/xfa/fwl/cfwl_widgetmgr.cpp index 825de0e14e..f01c02b6b8 100644 --- a/xfa/fwl/cfwl_widgetmgr.cpp +++ b/xfa/fwl/cfwl_widgetmgr.cpp @@ -148,18 +148,18 @@ void CFWL_WidgetMgr::AppendWidget(CFWL_Widget* pWidget) { } void CFWL_WidgetMgr::RepaintWidget(CFWL_Widget* pWidget, - const CFX_RectF* pRect) { + const CFX_RectF& rect) { if (!m_pAdapter) return; CFWL_Widget* pNative = pWidget; - CFX_RectF rect(*pRect); + CFX_RectF transformedRect = rect; if (IsFormDisabled()) { CFWL_Widget* pOuter = pWidget->GetOuter(); while (pOuter) { CFX_RectF rtTemp = pNative->GetWidgetRect(); - rect.left += rtTemp.left; - rect.top += rtTemp.top; + transformedRect.left += rtTemp.left; + transformedRect.top += rtTemp.top; pNative = pOuter; pOuter = pOuter->GetOuter(); } @@ -168,10 +168,10 @@ void CFWL_WidgetMgr::RepaintWidget(CFWL_Widget* pWidget, if (!pNative) return; - pWidget->TransformTo(pNative, rect.left, rect.top); + pWidget->TransformTo(pNative, transformedRect.left, transformedRect.top); } AddRedrawCounts(pNative); - m_pAdapter->RepaintWidget(pNative, &rect); + m_pAdapter->RepaintWidget(pNative); } void CFWL_WidgetMgr::InsertWidget(CFWL_Widget* pParent, CFWL_Widget* pChild) { @@ -497,11 +497,8 @@ void CFWL_WidgetMgr::OnDrawWidget(CFWL_Widget* pWidget, } #endif // _FX_OS_ == _FX_MACOSX_ - if (!IsFormDisabled()) { - CFX_RectF rtClient; - pWidget->GetClientRect(rtClient); - clipBounds.Intersect(rtClient); - } + if (!IsFormDisabled()) + clipBounds.Intersect(pWidget->GetClientRect()); if (!clipBounds.IsEmpty()) DrawChild(pWidget, clipBounds, pTemp, pMatrix); |