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

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

Issue 2492563002: Continue IFWL cleanup (Closed)
Patch Set: Rebase to master Created 4 years, 1 month 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/ifwl_listbox.h ('k') | xfa/fwl/core/ifwl_picturebox.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/fwl/core/ifwl_listbox.cpp
diff --git a/xfa/fwl/core/ifwl_listbox.cpp b/xfa/fwl/core/ifwl_listbox.cpp
index 9a713c09cd4f367cb115e26dbeff31181c72e7c0..e468602cdfc46e72cc62f55ee4ac343863599708 100644
--- a/xfa/fwl/core/ifwl_listbox.cpp
+++ b/xfa/fwl/core/ifwl_listbox.cpp
@@ -206,9 +206,9 @@ int32_t IFWL_ListBox::GetSelIndex(int32_t nIndex) {
return -1;
}
-FWL_Error IFWL_ListBox::SetSelItem(CFWL_ListItem* pItem, bool bSelect) {
+void IFWL_ListBox::SetSelItem(CFWL_ListItem* pItem, bool bSelect) {
if (!m_pProperties->m_pDataProvider)
- return FWL_Error::Indefinite;
+ return;
if (!pItem) {
if (bSelect) {
SelectAll();
@@ -216,36 +216,31 @@ FWL_Error IFWL_ListBox::SetSelItem(CFWL_ListItem* pItem, bool bSelect) {
ClearSelection();
SetFocusItem(nullptr);
}
- return FWL_Error::Indefinite;
+ return;
}
if (m_pProperties->m_dwStyleExes & FWL_STYLEEXT_LTB_MultiSelection) {
SetSelectionDirect(pItem, bSelect);
} else {
SetSelection(pItem, pItem, bSelect);
}
- return FWL_Error::Succeeded;
}
-FWL_Error IFWL_ListBox::GetItemText(CFWL_ListItem* pItem,
- CFX_WideString& wsText) {
+void IFWL_ListBox::GetItemText(CFWL_ListItem* pItem, CFX_WideString& wsText) {
if (!m_pProperties->m_pDataProvider)
- return FWL_Error::Indefinite;
+ return;
IFWL_ListBoxDP* pData =
static_cast<IFWL_ListBoxDP*>(m_pProperties->m_pDataProvider);
if (!pItem)
- return FWL_Error::Indefinite;
+ return;
pData->GetItemText(this, pItem, wsText);
- return FWL_Error::Succeeded;
}
-FWL_Error IFWL_ListBox::GetScrollPos(FX_FLOAT& fPos, bool bVert) {
+void IFWL_ListBox::GetScrollPos(FX_FLOAT& fPos, bool bVert) {
if ((bVert && IsShowScrollBar(true)) || (!bVert && IsShowScrollBar(false))) {
IFWL_ScrollBar* pScrollBar =
bVert ? m_pVertScrollBar.get() : m_pHorzScrollBar.get();
fPos = pScrollBar->GetPos();
- return FWL_Error::Succeeded;
}
- return FWL_Error::Indefinite;
}
CFWL_ListItem* IFWL_ListBox::GetItem(CFWL_ListItem* pItem, uint32_t dwKeyCode) {
@@ -699,7 +694,7 @@ CFX_SizeF IFWL_ListBox::CalcSize(bool bAutoSize) {
}
IFWL_ListBoxDP* pData =
static_cast<IFWL_ListBoxDP*>(m_pProperties->m_pDataProvider);
- m_fItemHeight = GetItemHeigt();
+ m_fItemHeight = CalcItemHeight();
if ((GetStylesEx() & FWL_STYLEEXT_LTB_Icon))
fWidth += m_fItemHeight;
@@ -856,7 +851,7 @@ FX_FLOAT IFWL_ListBox::GetScrollWidth() {
return *pfWidth;
}
-FX_FLOAT IFWL_ListBox::GetItemHeigt() {
+FX_FLOAT IFWL_ListBox::CalcItemHeight() {
FX_FLOAT* pfFont =
static_cast<FX_FLOAT*>(GetThemeCapacity(CFWL_WidgetCapacity::FontSize));
if (!pfFont)
@@ -873,8 +868,11 @@ void IFWL_ListBox::InitScrollBar(bool bVert) {
prop->m_dwStates = FWL_WGTSTATE_Invisible;
prop->m_pParent = this;
prop->m_pThemeProvider = m_pScrollBarTP;
- (bVert ? &m_pVertScrollBar : &m_pHorzScrollBar)
- ->reset(new IFWL_ScrollBar(m_pOwnerApp, std::move(prop), this));
+ IFWL_ScrollBar* sb = new IFWL_ScrollBar(m_pOwnerApp, std::move(prop), this);
+ if (bVert)
+ m_pVertScrollBar.reset(sb);
+ else
+ m_pHorzScrollBar.reset(sb);
}
bool IFWL_ListBox::IsShowScrollBar(bool bVert) {
« no previous file with comments | « xfa/fwl/core/ifwl_listbox.h ('k') | xfa/fwl/core/ifwl_picturebox.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698