Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(572)

Unified Diff: xfa/fwl/core/cfwl_listbox.cpp

Issue 2556873004: Convert GetWidgetRect to return rect. (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: xfa/fwl/core/cfwl_listbox.cpp
diff --git a/xfa/fwl/core/cfwl_listbox.cpp b/xfa/fwl/core/cfwl_listbox.cpp
index 5dd37d15d7b38a6fc1594c4b8974e604175457d4..4fbe4810281d7c28bdb6b3d5b0d1ac39c2da2a84 100644
--- a/xfa/fwl/core/cfwl_listbox.cpp
+++ b/xfa/fwl/core/cfwl_listbox.cpp
@@ -49,19 +49,18 @@ FWL_Type CFWL_ListBox::GetClassID() const {
return FWL_Type::ListBox;
}
-void CFWL_ListBox::GetWidgetRect(CFX_RectF& rect, bool bAutoSize) {
- if (!bAutoSize) {
- rect = m_pProperties->m_rtWidget;
- return;
- }
+CFX_RectF CFWL_ListBox::GetWidgetRect(bool bAutoSize) {
+ if (!bAutoSize)
+ return m_pProperties->m_rtWidget;
- rect.Set(0, 0, 0, 0);
if (!m_pProperties->m_pThemeProvider)
m_pProperties->m_pThemeProvider = GetAvailableTheme();
CFX_SizeF fs = CalcSize(true);
+ CFX_RectF rect;
rect.Set(0, 0, fs.x, fs.y);
InflateWidgetRect(rect);
+ return rect;
}
void CFWL_ListBox::Update() {
@@ -95,14 +94,12 @@ void CFWL_ListBox::Update() {
FWL_WidgetHit CFWL_ListBox::HitTest(FX_FLOAT fx, FX_FLOAT fy) {
if (IsShowScrollBar(false)) {
- CFX_RectF rect;
- m_pHorzScrollBar->GetWidgetRect(rect, false);
+ CFX_RectF rect = m_pHorzScrollBar->GetWidgetRect(false);
if (rect.Contains(fx, fy))
return FWL_WidgetHit::HScrollBar;
}
if (IsShowScrollBar(true)) {
- CFX_RectF rect;
- m_pVertScrollBar->GetWidgetRect(rect, false);
+ CFX_RectF rect = m_pVertScrollBar->GetWidgetRect(false);
if (rect.Contains(fx, fy))
return FWL_WidgetHit::VScrollBar;
}

Powered by Google App Engine
This is Rietveld 408576698