summaryrefslogtreecommitdiff
path: root/xfa/fwl/core/ifwl_listbox.cpp
diff options
context:
space:
mode:
authordsinclair <dsinclair@chromium.org>2016-11-21 12:18:28 -0800
committerCommit bot <commit-bot@chromium.org>2016-11-21 12:18:29 -0800
commit30e5f30f21c182eb54253008ad755abd991e2e07 (patch)
treea4fe0fc8d5b52e2a75b42318bf05cebc6f619a14 /xfa/fwl/core/ifwl_listbox.cpp
parentf5cabbfc3085a7a7a3451452c1a7ebe1f19c1223 (diff)
downloadpdfium-30e5f30f21c182eb54253008ad755abd991e2e07.tar.xz
Remove customized layout flag from FWL
The Customized Layout flag in FWL is always false. Removed the flag and updated the code as needed. Review-Url: https://codereview.chromium.org/2520023002
Diffstat (limited to 'xfa/fwl/core/ifwl_listbox.cpp')
-rw-r--r--xfa/fwl/core/ifwl_listbox.cpp56
1 files changed, 16 insertions, 40 deletions
diff --git a/xfa/fwl/core/ifwl_listbox.cpp b/xfa/fwl/core/ifwl_listbox.cpp
index a1646e2c92..aa17355b77 100644
--- a/xfa/fwl/core/ifwl_listbox.cpp
+++ b/xfa/fwl/core/ifwl_listbox.cpp
@@ -638,48 +638,24 @@ CFX_SizeF IFWL_ListBox::CalcSize(bool bAutoSize) {
}
}
- FX_FLOAT fWidth = 0;
- if (m_pProperties->m_pThemeProvider->IsCustomizedLayout(this)) {
- IFWL_ListBox::DataProvider* pData =
- static_cast<IFWL_ListBox::DataProvider*>(
- m_pProperties->m_pDataProvider);
- int32_t iCount = pData->CountItems(this);
- for (int32_t i = 0; i < iCount; i++) {
- CFWL_ListItem* pItem = pData->GetItem(this, i);
- if (!bAutoSize) {
- CFX_RectF rtItem;
- rtItem.Set(m_rtClient.left, m_rtClient.top + fs.y, 0, 0);
- IFWL_ListBox::DataProvider* pBox =
- static_cast<IFWL_ListBox::DataProvider*>(
- m_pProperties->m_pDataProvider);
- pBox->SetItemRect(this, pItem, rtItem);
- }
- if (fs.x < 0) {
- fs.x = 0;
- fWidth = 0;
- }
- }
- } else {
- fWidth = GetMaxTextWidth();
- fWidth += 2 * kItemTextMargin;
- if (!bAutoSize) {
- FX_FLOAT fActualWidth =
- m_rtClient.width - rtUIMargin.left - rtUIMargin.width;
- fWidth = std::max(fWidth, fActualWidth);
- }
+ FX_FLOAT fWidth = GetMaxTextWidth();
+ fWidth += 2 * kItemTextMargin;
+ if (!bAutoSize) {
+ FX_FLOAT fActualWidth =
+ m_rtClient.width - rtUIMargin.left - rtUIMargin.width;
+ fWidth = std::max(fWidth, fActualWidth);
+ }
- IFWL_ListBox::DataProvider* pData =
- static_cast<IFWL_ListBox::DataProvider*>(
- m_pProperties->m_pDataProvider);
- m_fItemHeight = CalcItemHeight();
- if ((GetStylesEx() & FWL_STYLEEXT_LTB_Icon))
- fWidth += m_fItemHeight;
+ IFWL_ListBox::DataProvider* pData =
+ static_cast<IFWL_ListBox::DataProvider*>(m_pProperties->m_pDataProvider);
+ m_fItemHeight = CalcItemHeight();
+ if ((GetStylesEx() & FWL_STYLEEXT_LTB_Icon))
+ fWidth += m_fItemHeight;
- int32_t iCount = pData->CountItems(this);
- for (int32_t i = 0; i < iCount; i++) {
- CFWL_ListItem* htem = pData->GetItem(this, i);
- GetItemSize(fs, htem, fWidth, m_fItemHeight, bAutoSize);
- }
+ int32_t iCount = pData->CountItems(this);
+ for (int32_t i = 0; i < iCount; i++) {
+ CFWL_ListItem* htem = pData->GetItem(this, i);
+ GetItemSize(fs, htem, fWidth, m_fItemHeight, bAutoSize);
}
if (bAutoSize)
return fs;