diff options
author | dsinclair <dsinclair@chromium.org> | 2016-12-07 18:10:16 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-12-07 18:10:16 -0800 |
commit | a2cbc570a035186529be151af0b3d44cf4106eee (patch) | |
tree | 1fbe99b81299839ff9c304739a85151d20c626b3 /xfa/fwl/core/cfwl_combobox.cpp | |
parent | 442997cbb3a9e970946dd294acd1498e9fa9bfc7 (diff) | |
download | pdfium-a2cbc570a035186529be151af0b3d44cf4106eee.tar.xz |
Cleanup return values in CFWL_ComboBox
This CL changes methods in CFWL_ComboBox to return values instead of taking
out params.
Review-Url: https://codereview.chromium.org/2555103005
Diffstat (limited to 'xfa/fwl/core/cfwl_combobox.cpp')
-rw-r--r-- | xfa/fwl/core/cfwl_combobox.cpp | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/xfa/fwl/core/cfwl_combobox.cpp b/xfa/fwl/core/cfwl_combobox.cpp index 2d59b7d5ec..8cc1e18873 100644 --- a/xfa/fwl/core/cfwl_combobox.cpp +++ b/xfa/fwl/core/cfwl_combobox.cpp @@ -252,12 +252,10 @@ void CFWL_ComboBox::SetThemeProvider(IFWL_ThemeProvider* pThemeProvider) { m_pEdit->SetThemeProvider(pThemeProvider); } -void CFWL_ComboBox::GetTextByIndex(int32_t iIndex, - CFX_WideString& wsText) const { +CFX_WideString CFWL_ComboBox::GetTextByIndex(int32_t iIndex) const { CFWL_ListItem* pItem = static_cast<CFWL_ListItem*>( m_pListBox->GetItem(m_pListBox.get(), iIndex)); - if (pItem) - wsText = pItem->m_wsText; + return pItem ? pItem->m_wsText : L""; } void CFWL_ComboBox::SetCurSel(int32_t iSel) { @@ -314,20 +312,19 @@ void CFWL_ComboBox::OpenDropDownList(bool bActivate) { ShowDropList(bActivate); } -void CFWL_ComboBox::GetBBox(CFX_RectF& rect) const { - if (m_pWidgetMgr->IsFormDisabled()) { - DisForm_GetBBox(rect); - return; - } +CFX_RectF CFWL_ComboBox::GetBBox() const { + if (m_pWidgetMgr->IsFormDisabled()) + return DisForm_GetBBox(); - rect = m_pProperties->m_rtWidget; + CFX_RectF rect = m_pProperties->m_rtWidget; if (!m_pListBox || !IsDropListVisible()) - return; + return rect; CFX_RectF rtList; m_pListBox->GetWidgetRect(rtList, false); rtList.Offset(rect.left, rect.top); rect.Union(rtList); + return rect; } void CFWL_ComboBox::EditModifyStylesEx(uint32_t dwStylesExAdded, @@ -737,15 +734,16 @@ void CFWL_ComboBox::DisForm_DrawWidget(CFX_Graphics* pGraphics, } } -void CFWL_ComboBox::DisForm_GetBBox(CFX_RectF& rect) const { - rect = m_pProperties->m_rtWidget; +CFX_RectF CFWL_ComboBox::DisForm_GetBBox() const { + CFX_RectF rect = m_pProperties->m_rtWidget; if (!m_pListBox || !DisForm_IsDropListVisible()) - return; + return rect; CFX_RectF rtList; m_pListBox->GetWidgetRect(rtList, false); rtList.Offset(rect.left, rect.top); rect.Union(rtList); + return rect; } void CFWL_ComboBox::DisForm_Layout() { |