diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2017-01-03 15:46:55 -0500 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-01-03 21:10:00 +0000 |
commit | c635c93c974db1c55032c36e81e98f3d214a249f (patch) | |
tree | 145a60ec7a1d43755e85e36890f73ba0e4625361 /xfa/fwl/cfwl_scrollbar.cpp | |
parent | 3cdcfeb04b5c496199d8c88ebd2402c3db4413ab (diff) | |
download | pdfium-c635c93c974db1c55032c36e81e98f3d214a249f.tar.xz |
Remove the ::GetCapacity methods.
The GetCapacity methods return a void* because they return different types of
internal class memory based on what the calling parameter was. This is confusing
and makes it difficult to tell when then enum values can be removed.
This CL removes GetCapacity and adds methods as needed to get the real values.
Change-Id: I64c2edc858220624880e27f4ed49c2dae080f462
Reviewed-on: https://pdfium-review.googlesource.com/2137
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'xfa/fwl/cfwl_scrollbar.cpp')
-rw-r--r-- | xfa/fwl/cfwl_scrollbar.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/xfa/fwl/cfwl_scrollbar.cpp b/xfa/fwl/cfwl_scrollbar.cpp index 016afd6d36..d4dd8885e3 100644 --- a/xfa/fwl/cfwl_scrollbar.cpp +++ b/xfa/fwl/cfwl_scrollbar.cpp @@ -20,7 +20,12 @@ #include "xfa/fwl/ifwl_themeprovider.h" #define FWL_SCROLLBAR_Elapse 500 -#define FWL_SCROLLBAR_MinThumb 5 + +namespace { + +const float kMinThumbSize = 5.0f; + +} // namespace CFWL_ScrollBar::CFWL_ScrollBar( const CFWL_App* app, @@ -46,7 +51,6 @@ CFWL_ScrollBar::CFWL_ScrollBar( m_bMouseDown(false), m_fButtonLen(0), m_bMinSize(false), - m_fMinThumb(FWL_SCROLLBAR_MinThumb), m_Timer(this) { m_rtClient.Reset(); m_rtThumb.Reset(); @@ -150,12 +154,8 @@ void CFWL_ScrollBar::DrawThumb(CFX_Graphics* pGraphics, } void CFWL_ScrollBar::Layout() { - IFWL_ThemeProvider* pTheme = m_pProperties->m_pThemeProvider; - CFWL_ThemePart part; - part.m_pWidget = this; - m_fMinThumb = *static_cast<FX_FLOAT*>( - pTheme->GetCapacity(&part, CFWL_WidgetCapacity::Size)); m_rtClient = GetClientRect(); + CalcButtonLen(); m_rtMinBtn = CalcMinButtonRect(); m_rtMaxBtn = CalcMaxButtonRect(); @@ -226,7 +226,7 @@ CFX_RectF CFWL_ScrollBar::CalcThumbButtonRect(const CFX_RectF& rtThumb) { fLength = 0.0f; FX_FLOAT fThumbSize = fLength * fLength / (fRange + fLength); - fThumbSize = std::max(fThumbSize, m_fMinThumb); + fThumbSize = std::max(fThumbSize, kMinThumbSize); FX_FLOAT fDiff = std::max(fLength - fThumbSize, 0.0f); FX_FLOAT fTrackPos = |