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_listbox.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_listbox.cpp')
-rw-r--r-- | xfa/fwl/cfwl_listbox.cpp | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/xfa/fwl/cfwl_listbox.cpp b/xfa/fwl/cfwl_listbox.cpp index d79e48991e..a7a568cd14 100644 --- a/xfa/fwl/cfwl_listbox.cpp +++ b/xfa/fwl/cfwl_listbox.cpp @@ -477,12 +477,12 @@ CFX_SizeF CFWL_ListBox::CalcSize(bool bAutoSize) { CFX_RectF rtUIMargin; rtUIMargin.Set(0, 0, 0, 0); if (!m_pOuter) { - CFX_RectF* pUIMargin = static_cast<CFX_RectF*>( - GetThemeCapacity(CFWL_WidgetCapacity::UIMargin)); - if (pUIMargin) { - m_rtConent.Deflate(pUIMargin->left, pUIMargin->top, pUIMargin->width, - pUIMargin->height); - } + CFWL_ThemePart part; + part.m_pWidget = this; + IFWL_ThemeProvider* theme = GetAvailableTheme(); + CFX_RectF pUIMargin = theme ? theme->GetUIMargin(&part) : CFX_RectF(); + m_rtConent.Deflate(pUIMargin.left, pUIMargin.top, pUIMargin.width, + pUIMargin.height); } FX_FLOAT fWidth = GetMaxTextWidth(); @@ -612,19 +612,15 @@ FX_FLOAT CFWL_ListBox::GetMaxTextWidth() { } FX_FLOAT CFWL_ListBox::GetScrollWidth() { - FX_FLOAT* pfWidth = static_cast<FX_FLOAT*>( - GetThemeCapacity(CFWL_WidgetCapacity::ScrollBarWidth)); - if (!pfWidth) - return 0; - return *pfWidth; + IFWL_ThemeProvider* theme = GetAvailableTheme(); + return theme ? theme->GetScrollBarWidth() : 0.0f; } FX_FLOAT CFWL_ListBox::CalcItemHeight() { - FX_FLOAT* pfFont = - static_cast<FX_FLOAT*>(GetThemeCapacity(CFWL_WidgetCapacity::FontSize)); - if (!pfFont) - return 20; - return *pfFont + 2 * kItemTextMargin; + IFWL_ThemeProvider* theme = GetAvailableTheme(); + CFWL_ThemePart part; + part.m_pWidget = this; + return (theme ? theme->GetFontSize(&part) : 20.0f) + 2 * kItemTextMargin; } void CFWL_ListBox::InitVerticalScrollBar() { |