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_widget.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_widget.cpp')
-rw-r--r-- | xfa/fwl/cfwl_widget.cpp | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/xfa/fwl/cfwl_widget.cpp b/xfa/fwl/cfwl_widget.cpp index 7da12fcfba..301ad5fc9d 100644 --- a/xfa/fwl/cfwl_widget.cpp +++ b/xfa/fwl/cfwl_widget.cpp @@ -292,11 +292,10 @@ CFX_RectF CFWL_Widget::GetEdgeRect() { } FX_FLOAT CFWL_Widget::GetBorderSize(bool bCX) { - FX_FLOAT* pfBorder = static_cast<FX_FLOAT*>(GetThemeCapacity( - bCX ? CFWL_WidgetCapacity::CXBorder : CFWL_WidgetCapacity::CYBorder)); - if (!pfBorder) - return 0; - return *pfBorder; + IFWL_ThemeProvider* theme = GetAvailableTheme(); + if (!theme) + return 0.0f; + return bCX ? theme->GetCXBorderSize() : theme->GetCYBorderSize(); } CFX_RectF CFWL_Widget::GetRelativeRect() { @@ -306,16 +305,6 @@ CFX_RectF CFWL_Widget::GetRelativeRect() { return rect; } -void* CFWL_Widget::GetThemeCapacity(CFWL_WidgetCapacity dwCapacity) { - IFWL_ThemeProvider* pTheme = GetAvailableTheme(); - if (!pTheme) - return nullptr; - - CFWL_ThemePart part; - part.m_pWidget = this; - return pTheme->GetCapacity(&part, dwCapacity); -} - IFWL_ThemeProvider* CFWL_Widget::GetAvailableTheme() { if (m_pProperties->m_pThemeProvider) return m_pProperties->m_pThemeProvider; |