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

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

Issue 2555103005: Cleanup return values in CFWL_ComboBox (Closed)
Patch Set: Rebase to master 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
« no previous file with comments | « xfa/fwl/core/cfwl_combobox.h ('k') | xfa/fxfa/app/xfa_ffchoicelist.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/fwl/core/cfwl_combobox.cpp
diff --git a/xfa/fwl/core/cfwl_combobox.cpp b/xfa/fwl/core/cfwl_combobox.cpp
index 2d59b7d5ece7a1f6ec2b2582cf2908a71cb86fce..8cc1e18873bdce31068dfe828551de4c48b3912f 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() {
« no previous file with comments | « xfa/fwl/core/cfwl_combobox.h ('k') | xfa/fxfa/app/xfa_ffchoicelist.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698