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_checkbox.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_checkbox.cpp')
-rw-r--r-- | xfa/fwl/core/cfwl_checkbox.cpp | 26 |
1 files changed, 1 insertions, 25 deletions
diff --git a/xfa/fwl/core/cfwl_checkbox.cpp b/xfa/fwl/core/cfwl_checkbox.cpp index 4183551f68..8d99d7acf5 100644 --- a/xfa/fwl/core/cfwl_checkbox.cpp +++ b/xfa/fwl/core/cfwl_checkbox.cpp @@ -50,29 +50,6 @@ 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; - } - - rect.Set(0, 0, 0, 0); - if (!m_pProperties->m_pThemeProvider) - m_pProperties->m_pThemeProvider = GetAvailableTheme(); - if (!m_pProperties->m_pThemeProvider) - return; - - CFX_SizeF sz = CalcTextSize( - L"Check box", m_pProperties->m_pThemeProvider, - !!(m_pProperties->m_dwStyleExes & FWL_STYLEEXT_CKB_MultiLine)); - rect.Set(0, 0, sz.x, sz.y); - rect.Inflate(kCaptionMargin, kCaptionMargin); - - rect.width += m_fBoxHeight; - rect.height = std::max(rect.height, m_fBoxHeight); - InflateWidgetRect(rect); -} - void CFWL_CheckBox::Update() { if (IsLocked()) return; @@ -308,8 +285,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(); rt.left = rt.top = 0; m_pWidgetMgr->RepaintWidget(pCheckBox, &rt); break; |