diff options
author | dsinclair <dsinclair@chromium.org> | 2016-12-14 06:25:02 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-12-14 06:25:02 -0800 |
commit | 603f57b85c0643f0598f03b97c4525501f3e1221 (patch) | |
tree | 85c9521a8f0fec47ba84041d64cb84e6bc019638 /xfa/fwl/cfwl_combobox.cpp | |
parent | a9caab94c1f16929e5acf2676117224617d80f53 (diff) | |
download | pdfium-603f57b85c0643f0598f03b97c4525501f3e1221.tar.xz |
Update CFWL_ListBox to return instead of using out params.
This CL updates the CFWL_ListBox code to work with return values instead
of out params. This also extracts the CFWL_ListItem code out of CFWL_ListBox
and puts into the correct class.
Review-Url: https://codereview.chromium.org/2572783002
Diffstat (limited to 'xfa/fwl/cfwl_combobox.cpp')
-rw-r--r-- | xfa/fwl/cfwl_combobox.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/xfa/fwl/cfwl_combobox.cpp b/xfa/fwl/cfwl_combobox.cpp index 7e5d1b8d74..8567e68dff 100644 --- a/xfa/fwl/cfwl_combobox.cpp +++ b/xfa/fwl/cfwl_combobox.cpp @@ -76,8 +76,8 @@ void CFWL_ComboBox::AddString(const CFX_WideStringC& wsText) { m_pListBox->AddString(wsText); } -bool CFWL_ComboBox::RemoveAt(int32_t iIndex) { - return m_pListBox->RemoveAt(iIndex); +void CFWL_ComboBox::RemoveAt(int32_t iIndex) { + m_pListBox->RemoveAt(iIndex); } void CFWL_ComboBox::RemoveAll() { @@ -222,7 +222,7 @@ void CFWL_ComboBox::SetThemeProvider(IFWL_ThemeProvider* pThemeProvider) { CFX_WideString CFWL_ComboBox::GetTextByIndex(int32_t iIndex) const { CFWL_ListItem* pItem = static_cast<CFWL_ListItem*>( m_pListBox->GetItem(m_pListBox.get(), iIndex)); - return pItem ? pItem->m_wsText : L""; + return pItem ? pItem->GetText() : L""; } void CFWL_ComboBox::SetCurSel(int32_t iSel) { @@ -511,10 +511,8 @@ void CFWL_ComboBox::ProcessSelChanged(bool bLButtonUp) { CFWL_ListItem* hItem = m_pListBox->GetItem(this, m_iCurSel); if (!hItem) return; - - CFX_WideString wsText = m_pListBox->GetItemText(this, hItem); if (m_pEdit) { - m_pEdit->SetText(wsText); + m_pEdit->SetText(hItem->GetText()); m_pEdit->Update(); m_pEdit->SetSelected(); } |