summaryrefslogtreecommitdiff
path: root/xfa/fwl/cfwl_combobox.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-01-03 15:46:55 -0500
committerChromium commit bot <commit-bot@chromium.org>2017-01-03 21:10:00 +0000
commitc635c93c974db1c55032c36e81e98f3d214a249f (patch)
tree145a60ec7a1d43755e85e36890f73ba0e4625361 /xfa/fwl/cfwl_combobox.cpp
parent3cdcfeb04b5c496199d8c88ebd2402c3db4413ab (diff)
downloadpdfium-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_combobox.cpp')
-rw-r--r--xfa/fwl/cfwl_combobox.cpp34
1 files changed, 12 insertions, 22 deletions
diff --git a/xfa/fwl/cfwl_combobox.cpp b/xfa/fwl/cfwl_combobox.cpp
index c07e0cf246..03d2921e65 100644
--- a/xfa/fwl/cfwl_combobox.cpp
+++ b/xfa/fwl/cfwl_combobox.cpp
@@ -35,8 +35,7 @@ CFWL_ComboBox::CFWL_ComboBox(const CFWL_App* app)
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 @@ void CFWL_ComboBox::Update() {
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 @@ void CFWL_ComboBox::ShowDropList(bool bActivate) {
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 @@ void CFWL_ComboBox::Layout() {
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 @@ CFX_RectF CFWL_ComboBox::DisForm_GetBBox() const {
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;