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_pushbutton.cpp | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'xfa/fwl/core/ifwl_pushbutton.cpp') diff --git a/xfa/fwl/core/ifwl_pushbutton.cpp b/xfa/fwl/core/ifwl_pushbutton.cpp index c03b26a9b6..da36e71b01 100644 --- a/xfa/fwl/core/ifwl_pushbutton.cpp +++ b/xfa/fwl/core/ifwl_pushbutton.cpp @@ -32,7 +32,7 @@ FWL_Type IFWL_PushButton::GetClassID() const { return FWL_Type::PushButton; } -FWL_Error IFWL_PushButton::GetWidgetRect(CFX_RectF& rect, bool bAutoSize) { +void IFWL_PushButton::GetWidgetRect(CFX_RectF& rect, bool bAutoSize) { if (bAutoSize) { rect.Set(0, 0, 0, 0); if (!m_pProperties->m_pThemeProvider) { @@ -56,7 +56,6 @@ FWL_Error IFWL_PushButton::GetWidgetRect(CFX_RectF& rect, bool bAutoSize) { } else { rect = m_pProperties->m_rtWidget; } - return FWL_Error::Succeeded; } void IFWL_PushButton::SetStates(uint32_t dwStates, bool bSet) { @@ -67,9 +66,9 @@ void IFWL_PushButton::SetStates(uint32_t dwStates, bool bSet) { IFWL_Widget::SetStates(dwStates, bSet); } -FWL_Error IFWL_PushButton::Update() { +void IFWL_PushButton::Update() { if (IsLocked()) { - return FWL_Error::Indefinite; + return; } if (!m_pProperties->m_pThemeProvider) { m_pProperties->m_pThemeProvider = GetAvailableTheme(); @@ -80,15 +79,14 @@ FWL_Error IFWL_PushButton::Update() { FX_FLOAT* fcaption = static_cast(GetThemeCapacity(CFWL_WidgetCapacity::Margin)); m_rtCaption.Inflate(-*fcaption, -*fcaption); - return FWL_Error::Succeeded; } -FWL_Error IFWL_PushButton::DrawWidget(CFX_Graphics* pGraphics, - const CFX_Matrix* pMatrix) { +void IFWL_PushButton::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_PushButtonDP* pData = static_cast(m_pProperties->m_pDataProvider); CFX_DIBitmap* pPicture = nullptr; @@ -269,7 +267,6 @@ FWL_Error IFWL_PushButton::DrawWidget(CFX_Graphics* pGraphics, DrawText(pGraphics, m_pProperties->m_pThemeProvider, &matrix); break; } - return FWL_Error::Succeeded; } void IFWL_PushButton::DrawBkground(CFX_Graphics* pGraphics, -- cgit v1.2.3