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>
diff --git a/xfa/fwl/cfwl_combobox.cpp b/xfa/fwl/cfwl_combobox.cpp
index c07e0cf..03d2921 100644
--- a/xfa/fwl/cfwl_combobox.cpp
+++ b/xfa/fwl/cfwl_combobox.cpp
@@ -35,8 +35,7 @@
       m_pComboBoxProxy(nullptr),
       m_bLButtonDown(false),
       m_iCurSel(-1),
-      m_iBtnState(CFWL_PartState_Normal),
-      m_fComboFormHandler(0) {
+      m_iBtnState(CFWL_PartState_Normal) {
   m_rtClient.Reset();
   m_rtBtn.Reset();
   m_rtHandler.Reset();
@@ -117,11 +116,6 @@
     m_pProperties->m_pThemeProvider = GetAvailableTheme();
 
   Layout();
-  CFWL_ThemePart part;
-  part.m_pWidget = this;
-  m_fComboFormHandler =
-      *static_cast<FX_FLOAT*>(m_pProperties->m_pThemeProvider->GetCapacity(
-          &part, CFWL_WidgetCapacity::ComboFormHandler));
 }
 
 FWL_WidgetHit CFWL_ComboBox::HitTest(FX_FLOAT fx, FX_FLOAT fy) {
@@ -349,7 +343,6 @@
   CFWL_Event ev(CFWL_Event::Type::PreDropDown, this);
   DispatchEvent(&ev);
 
-  m_fItemHeight = m_pListBox->GetItemHeight();
   m_pListBox->SetFocus(true);
   m_pComboBoxProxy->DoModal();
   m_pListBox->SetFocus(false);
@@ -380,12 +373,11 @@
     return DisForm_Layout();
 
   m_rtClient = GetClientRect();
-  FX_FLOAT* pFWidth = static_cast<FX_FLOAT*>(
-      GetThemeCapacity(CFWL_WidgetCapacity::ScrollBarWidth));
-  if (!pFWidth)
+  IFWL_ThemeProvider* theme = GetAvailableTheme();
+  if (!theme)
     return;
 
-  FX_FLOAT fBtn = *pFWidth;
+  FX_FLOAT fBtn = theme->GetScrollBarWidth();
   m_rtBtn.Set(m_rtClient.right() - fBtn, m_rtClient.top, fBtn,
               m_rtClient.height);
   if (!IsDropDownStyle() || !m_pEdit)
@@ -680,24 +672,22 @@
 void CFWL_ComboBox::DisForm_Layout() {
   m_rtClient = GetClientRect();
   m_rtContent = m_rtClient;
-  FX_FLOAT* pFWidth = static_cast<FX_FLOAT*>(
-      GetThemeCapacity(CFWL_WidgetCapacity::ScrollBarWidth));
-  if (!pFWidth)
+  IFWL_ThemeProvider* theme = GetAvailableTheme();
+  if (!theme)
     return;
 
   FX_FLOAT borderWidth = 1;
-  FX_FLOAT fBtn = *pFWidth;
+  FX_FLOAT fBtn = theme->GetScrollBarWidth();
   if (!(GetStylesEx() & FWL_STYLEEXT_CMB_ReadOnly)) {
     m_rtBtn.Set(m_rtClient.right() - fBtn, m_rtClient.top + borderWidth,
                 fBtn - borderWidth, m_rtClient.height - 2 * borderWidth);
   }
 
-  CFX_RectF* pUIMargin =
-      static_cast<CFX_RectF*>(GetThemeCapacity(CFWL_WidgetCapacity::UIMargin));
-  if (pUIMargin) {
-    m_rtContent.Deflate(pUIMargin->left, pUIMargin->top, pUIMargin->width,
-                        pUIMargin->height);
-  }
+  CFWL_ThemePart part;
+  part.m_pWidget = this;
+  CFX_RectF pUIMargin = theme->GetUIMargin(&part);
+  m_rtContent.Deflate(pUIMargin.left, pUIMargin.top, pUIMargin.width,
+                      pUIMargin.height);
 
   if (!IsDropDownStyle() || !m_pEdit)
     return;