From 98329fe75b9c3e5422344a37d787fb22c89c2ca2 Mon Sep 17 00:00:00 2001 From: dsinclair Date: Thu, 10 Nov 2016 09:40:14 -0800 Subject: Cleanup IFWL_Widget visibility and virtual parameters This Cl cleans up the IFWL_Widget class including: * Making members and methods private where possible * Removing virtual methods that are never overridden * Removing methods that do nothing * Removing unchecked FWL_Error return codes Review-Url: https://codereview.chromium.org/2488953003 --- xfa/fwl/core/ifwl_listbox.cpp | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) (limited to 'xfa/fwl/core/ifwl_listbox.cpp') diff --git a/xfa/fwl/core/ifwl_listbox.cpp b/xfa/fwl/core/ifwl_listbox.cpp index f54c089a9a..aef74ae746 100644 --- a/xfa/fwl/core/ifwl_listbox.cpp +++ b/xfa/fwl/core/ifwl_listbox.cpp @@ -42,7 +42,7 @@ FWL_Type IFWL_ListBox::GetClassID() const { return FWL_Type::ListBox; } -FWL_Error IFWL_ListBox::GetWidgetRect(CFX_RectF& rect, bool bAutoSize) { +void IFWL_ListBox::GetWidgetRect(CFX_RectF& rect, bool bAutoSize) { if (bAutoSize) { rect.Set(0, 0, 0, 0); if (!m_pProperties->m_pThemeProvider) { @@ -54,12 +54,11 @@ FWL_Error IFWL_ListBox::GetWidgetRect(CFX_RectF& rect, bool bAutoSize) { } else { rect = m_pProperties->m_rtWidget; } - return FWL_Error::Succeeded; } -FWL_Error IFWL_ListBox::Update() { +void IFWL_ListBox::Update() { if (IsLocked()) { - return FWL_Error::Indefinite; + return; } if (!m_pProperties->m_pThemeProvider) { m_pProperties->m_pThemeProvider = GetAvailableTheme(); @@ -83,7 +82,6 @@ FWL_Error IFWL_ListBox::Update() { m_dwTTOStyles |= FDE_TTOSTYLE_SingleLine; m_fScorllBarWidth = GetScrollWidth(); CalcSize(); - return FWL_Error::Succeeded; } FWL_WidgetHit IFWL_ListBox::HitTest(FX_FLOAT fx, FX_FLOAT fy) { @@ -104,12 +102,12 @@ FWL_WidgetHit IFWL_ListBox::HitTest(FX_FLOAT fx, FX_FLOAT fy) { return FWL_WidgetHit::Unknown; } -FWL_Error IFWL_ListBox::DrawWidget(CFX_Graphics* pGraphics, - const CFX_Matrix* pMatrix) { +void IFWL_ListBox::DrawWidget(CFX_Graphics* pGraphics, + const CFX_Matrix* pMatrix) { if (!pGraphics) - return FWL_Error::Indefinite; + return; if (!m_pProperties->m_pThemeProvider) - return FWL_Error::Indefinite; + return; IFWL_ThemeProvider* pTheme = m_pProperties->m_pThemeProvider; pGraphics->SaveGraphState(); if (HasBorder()) { @@ -134,14 +132,11 @@ FWL_Error IFWL_ListBox::DrawWidget(CFX_Graphics* pGraphics, } DrawItems(pGraphics, pTheme, pMatrix); pGraphics->RestoreGraphState(); - return FWL_Error::Succeeded; } -FWL_Error IFWL_ListBox::SetThemeProvider(IFWL_ThemeProvider* pThemeProvider) { - if (!pThemeProvider) - return FWL_Error::Indefinite; - m_pProperties->m_pThemeProvider = pThemeProvider; - return FWL_Error::Succeeded; +void IFWL_ListBox::SetThemeProvider(IFWL_ThemeProvider* pThemeProvider) { + if (pThemeProvider) + m_pProperties->m_pThemeProvider = pThemeProvider; } int32_t IFWL_ListBox::CountSelItems() { if (!m_pProperties->m_pDataProvider) -- cgit v1.2.3