diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2016-11-23 13:04:07 -0500 |
---|---|---|
committer | Dan Sinclair <dsinclair@chromium.org> | 2016-11-23 13:04:07 -0500 |
commit | 7172b71a005c181e9f103ac0e19f6675bf3bc8e8 (patch) | |
tree | 433b3e8294fb1c45d7407b67030c5230ffb893c7 /xfa/fwl | |
parent | 0ced827f257344a1f5804aa96df538f3e783bd10 (diff) | |
download | pdfium-7172b71a005c181e9f103ac0e19f6675bf3bc8e8.tar.xz |
Remove IFWL_CombobBox::DataProvider
The height value returned is always 0. This CL removes the plumbing and uses
the 0 value directly.
R=npm@chromium.org, tsepez@chromium.org
Review URL: https://codereview.chromium.org/2525003002 .
Diffstat (limited to 'xfa/fwl')
-rw-r--r-- | xfa/fwl/core/cfwl_combobox.cpp | 7 | ||||
-rw-r--r-- | xfa/fwl/core/cfwl_combobox.h | 8 | ||||
-rw-r--r-- | xfa/fwl/core/ifwl_combobox.cpp | 14 | ||||
-rw-r--r-- | xfa/fwl/core/ifwl_combobox.h | 6 |
4 files changed, 3 insertions, 32 deletions
diff --git a/xfa/fwl/core/cfwl_combobox.cpp b/xfa/fwl/core/cfwl_combobox.cpp index 9af4b8da7d..7eb04b5118 100644 --- a/xfa/fwl/core/cfwl_combobox.cpp +++ b/xfa/fwl/core/cfwl_combobox.cpp @@ -21,8 +21,7 @@ IFWL_ComboBox* ToComboBox(IFWL_Widget* widget) { } // namespace -CFWL_ComboBox::CFWL_ComboBox(const CFWL_App* app) - : CFWL_Widget(app), m_fMaxListHeight(0) {} +CFWL_ComboBox::CFWL_ComboBox(const CFWL_App* app) : CFWL_Widget(app) {} CFWL_ComboBox::~CFWL_ComboBox() {} @@ -49,10 +48,6 @@ void CFWL_ComboBox::RemoveAll() { ToComboBox(GetWidget())->RemoveAll(); } -FX_FLOAT CFWL_ComboBox::GetListHeight(IFWL_Widget* pWidget) { - return m_fMaxListHeight; -} - void CFWL_ComboBox::GetTextByIndex(int32_t iIndex, CFX_WideString& wsText) const { if (!GetWidget()) diff --git a/xfa/fwl/core/cfwl_combobox.h b/xfa/fwl/core/cfwl_combobox.h index 2b63c50aad..a670ef22cb 100644 --- a/xfa/fwl/core/cfwl_combobox.h +++ b/xfa/fwl/core/cfwl_combobox.h @@ -13,16 +13,13 @@ #include "xfa/fwl/core/cfwl_widget.h" #include "xfa/fwl/core/ifwl_combobox.h" -class CFWL_ComboBox : public CFWL_Widget, public IFWL_ComboBox::DataProvider { +class CFWL_ComboBox : public CFWL_Widget, public IFWL_Widget::DataProvider { public: explicit CFWL_ComboBox(const CFWL_App* pApp); ~CFWL_ComboBox() override; void Initialize(); - // IFWL_ComboBox::DataProvider - FX_FLOAT GetListHeight(IFWL_Widget* pWidget) override; - void AddString(const CFX_WideStringC& wsText); bool RemoveAt(int32_t iIndex); // Returns false iff |iIndex| out of range. void RemoveAll(); @@ -54,9 +51,6 @@ class CFWL_ComboBox : public CFWL_Widget, public IFWL_ComboBox::DataProvider { void GetBBox(CFX_RectF& rect); void EditModifyStylesEx(uint32_t dwStylesExAdded, uint32_t dwStylesExRemoved); - - private: - FX_FLOAT m_fMaxListHeight; }; #endif // XFA_FWL_CORE_CFWL_COMBOBOX_H_ diff --git a/xfa/fwl/core/ifwl_combobox.cpp b/xfa/fwl/core/ifwl_combobox.cpp index 906fe1d6ef..19d1c3f87f 100644 --- a/xfa/fwl/core/ifwl_combobox.cpp +++ b/xfa/fwl/core/ifwl_combobox.cpp @@ -337,12 +337,6 @@ void IFWL_ComboBox::EditModifyStylesEx(uint32_t dwStylesExAdded, m_pEdit->ModifyStylesEx(dwStylesExAdded, dwStylesExRemoved); } -FX_FLOAT IFWL_ComboBox::GetDataProviderListHeight() { - return static_cast<IFWL_ComboBox::DataProvider*>( - m_pProperties->m_pDataProvider) - ->GetListHeight(this); -} - void IFWL_ComboBox::DrawStretchHandler(CFX_Graphics* pGraphics, const CFX_Matrix* pMatrix) { CFWL_ThemeBackground param; @@ -381,11 +375,6 @@ void IFWL_ComboBox::ShowDropList(bool bActivate) { (FWL_STYLEEXT_CMB_Sort | FWL_STYLEEXT_CMB_OwnerDraw); m_pListBox->ModifyStylesEx(dwStyleAdd, 0); m_pListBox->GetWidgetRect(m_rtList, true); - FX_FLOAT fHeight = GetDataProviderListHeight(); - if (fHeight > 0 && m_rtList.height > fHeight) { - m_rtList.height = fHeight; - m_pListBox->ModifyStyles(FWL_WGTSTYLE_VScroll, 0); - } CFX_RectF rtAnchor; rtAnchor.Set(0, 0, m_pProperties->m_rtWidget.width, @@ -396,8 +385,7 @@ void IFWL_ComboBox::ShowDropList(bool bActivate) { if (m_pProperties->m_dwStyleExes & FWL_STYLEEXT_CMB_ListDrag) m_rtProxy.height += m_fComboFormHandler; - FX_FLOAT fMinHeight = 0; - GetPopupPos(fMinHeight, m_rtProxy.height, rtAnchor, m_rtProxy); + GetPopupPos(0, m_rtProxy.height, rtAnchor, m_rtProxy); if (m_pProperties->m_dwStyleExes & FWL_STYLEEXT_CMB_ListDrag) { FX_FLOAT fx = 0; FX_FLOAT fy = m_rtClient.top + m_rtClient.height / 2; diff --git a/xfa/fwl/core/ifwl_combobox.h b/xfa/fwl/core/ifwl_combobox.h index 7ad7420c9b..dfe9d646cd 100644 --- a/xfa/fwl/core/ifwl_combobox.h +++ b/xfa/fwl/core/ifwl_combobox.h @@ -49,11 +49,6 @@ class IFWL_Widget; class IFWL_ComboBox : public IFWL_Widget { public: - class DataProvider : public IFWL_Widget::DataProvider { - public: - virtual FX_FLOAT GetListHeight(IFWL_Widget* pWidget) = 0; - }; - explicit IFWL_ComboBox(const CFWL_App* app, std::unique_ptr<CFWL_WidgetProperties> properties); ~IFWL_ComboBox() override; @@ -125,7 +120,6 @@ class IFWL_ComboBox : public IFWL_Widget { int32_t GetCurrentSelection() const { return m_iCurSel; } private: - FX_FLOAT GetDataProviderListHeight(); bool IsDropDownStyle() const { return !!(m_pProperties->m_dwStyleExes & FWL_STYLEEXT_CMB_DropDown); } |