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

Unified Diff: xfa/fwl/core/cfwl_checkbox.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_checkbox.cpp
diff --git a/xfa/fwl/core/cfwl_checkbox.cpp b/xfa/fwl/core/cfwl_checkbox.cpp
index 4183551f68df61bc0e69bbe1e13c50bf65ec7dcd..97116d45cae0fc5fa6280460360ce8a235a913a8 100644
--- a/xfa/fwl/core/cfwl_checkbox.cpp
+++ b/xfa/fwl/core/cfwl_checkbox.cpp
@@ -50,17 +50,15 @@ void CFWL_CheckBox::SetBoxSize(FX_FLOAT fHeight) {
m_fBoxHeight = fHeight;
}
-void CFWL_CheckBox::GetWidgetRect(CFX_RectF& rect, bool bAutoSize) {
- if (!bAutoSize) {
- rect = m_pProperties->m_rtWidget;
- return;
- }
+CFX_RectF CFWL_CheckBox::GetWidgetRect(bool bAutoSize) {
+ if (!bAutoSize)
+ return m_pProperties->m_rtWidget;
- rect.Set(0, 0, 0, 0);
+ CFX_RectF rect;
if (!m_pProperties->m_pThemeProvider)
m_pProperties->m_pThemeProvider = GetAvailableTheme();
if (!m_pProperties->m_pThemeProvider)
- return;
+ return rect;
CFX_SizeF sz = CalcTextSize(
L"Check box", m_pProperties->m_pThemeProvider,
@@ -71,6 +69,7 @@ void CFWL_CheckBox::GetWidgetRect(CFX_RectF& rect, bool bAutoSize) {
rect.width += m_fBoxHeight;
rect.height = std::max(rect.height, m_fBoxHeight);
InflateWidgetRect(rect);
+ return rect;
}
void CFWL_CheckBox::Update() {
@@ -308,8 +307,7 @@ void CFWL_CheckBox::NextStates() {
if (pCheckBox != this &&
pCheckBox->GetStates() & FWL_STATE_CKB_Checked) {
pCheckBox->SetCheckState(0);
- CFX_RectF rt;
- pCheckBox->GetWidgetRect(rt, false);
+ CFX_RectF rt = pCheckBox->GetWidgetRect(false);
rt.left = rt.top = 0;
m_pWidgetMgr->RepaintWidget(pCheckBox, &rt);
break;

Powered by Google App Engine
This is Rietveld 408576698