summaryrefslogtreecommitdiff
path: root/xfa/fwl/basewidget
diff options
context:
space:
mode:
authordsinclair <dsinclair@chromium.org>2016-10-17 18:14:25 -0700
committerCommit bot <commit-bot@chromium.org>2016-10-17 18:14:25 -0700
commit878dd5b121b38e6eaba5b3f3a90d0a9abf60feaf (patch)
tree6b490d5e54c0d2e213d18b5e4bfe106f61eb1390 /xfa/fwl/basewidget
parent8021a646f18d76518be32c36907a04f213a0e21c (diff)
downloadpdfium-878dd5b121b38e6eaba5b3f3a90d0a9abf60feaf.tar.xz
Cleanup unneeded FWL theme code.
This CL removes FWL theme code methods which do not have implementations. Review-Url: https://codereview.chromium.org/2422373002
Diffstat (limited to 'xfa/fwl/basewidget')
-rw-r--r--xfa/fwl/basewidget/fwl_comboboximp.cpp21
-rw-r--r--xfa/fwl/basewidget/fwl_listboximp.cpp20
-rw-r--r--xfa/fwl/basewidget/fwl_scrollbarimp.cpp51
3 files changed, 27 insertions, 65 deletions
diff --git a/xfa/fwl/basewidget/fwl_comboboximp.cpp b/xfa/fwl/basewidget/fwl_comboboximp.cpp
index ded0da51f5..17c5bf80d4 100644
--- a/xfa/fwl/basewidget/fwl_comboboximp.cpp
+++ b/xfa/fwl/basewidget/fwl_comboboximp.cpp
@@ -695,12 +695,10 @@ FWL_Error CFWL_ComboBoxImp::SetThemeProvider(
if (!pThemeProvider)
return FWL_Error::Indefinite;
m_pProperties->m_pThemeProvider = pThemeProvider;
- if (m_pListBox && pThemeProvider->IsValidWidget(m_pListBox.get())) {
+ if (m_pListBox)
m_pListBox->SetThemeProvider(pThemeProvider);
- }
- if (m_pEdit && pThemeProvider->IsValidWidget(m_pEdit.get())) {
+ if (m_pEdit)
m_pEdit->SetThemeProvider(pThemeProvider);
- }
return FWL_Error::Succeeded;
}
int32_t CFWL_ComboBoxImp::GetCurSel() {
@@ -1042,17 +1040,10 @@ void CFWL_ComboBoxImp::ReSetTheme() {
pTheme = GetAvailableTheme();
m_pProperties->m_pThemeProvider = pTheme;
}
- if (m_pListBox) {
- if (!m_pListBox->GetThemeProvider() &&
- pTheme->IsValidWidget(m_pListBox.get())) {
- m_pListBox->SetThemeProvider(pTheme);
- }
- }
- if (m_pEdit) {
- if (!m_pEdit->GetThemeProvider() && pTheme->IsValidWidget(m_pEdit.get())) {
- m_pEdit->SetThemeProvider(pTheme);
- }
- }
+ if (m_pListBox && !m_pListBox->GetThemeProvider())
+ m_pListBox->SetThemeProvider(pTheme);
+ if (m_pEdit && !m_pEdit->GetThemeProvider())
+ m_pEdit->SetThemeProvider(pTheme);
}
void CFWL_ComboBoxImp::ReSetEditAlignment() {
if (!m_pEdit)
diff --git a/xfa/fwl/basewidget/fwl_listboximp.cpp b/xfa/fwl/basewidget/fwl_listboximp.cpp
index 3f65837883..33a0a8d1ee 100644
--- a/xfa/fwl/basewidget/fwl_listboximp.cpp
+++ b/xfa/fwl/basewidget/fwl_listboximp.cpp
@@ -202,10 +202,6 @@ FWL_Error CFWL_ListBoxImp::SetThemeProvider(
IFWL_ThemeProvider* pThemeProvider) {
if (!pThemeProvider)
return FWL_Error::Indefinite;
- if (!pThemeProvider->IsValidWidget(m_pInterface)) {
- m_pScrollBarTP = pThemeProvider;
- return FWL_Error::Succeeded;
- }
m_pProperties->m_pThemeProvider = pThemeProvider;
return FWL_Error::Succeeded;
}
@@ -733,24 +729,16 @@ CFX_SizeF CFWL_ListBoxImp::CalcSize(FX_BOOL bAutoSize) {
int32_t iCount = pData->CountItems(m_pInterface);
for (int32_t i = 0; i < iCount; i++) {
IFWL_ListItem* pItem = pData->GetItem(m_pInterface, i);
- CFWL_ThemePart itemPart;
- itemPart.m_pWidget = m_pInterface;
- itemPart.m_iPart = CFWL_Part::ListItem;
- itemPart.m_pData = m_pProperties->m_pDataProvider;
- itemPart.m_bMaximize = i > 0;
- CFX_RectF r;
- m_pProperties->m_pThemeProvider->GetPartRect(&itemPart, r);
if (!bAutoSize) {
CFX_RectF rtItem;
- rtItem.Set(m_rtClient.left, m_rtClient.top + fs.y, r.width, r.height);
+ rtItem.Set(m_rtClient.left, m_rtClient.top + fs.y, 0, 0);
IFWL_ListBoxDP* pBox =
static_cast<IFWL_ListBoxDP*>(m_pProperties->m_pDataProvider);
pBox->SetItemRect(m_pInterface, pItem, rtItem);
}
- fs.y += r.height;
- if (fs.x < r.width) {
- fs.x = r.width;
- fWidth = r.width;
+ if (fs.x < 0) {
+ fs.x = 0;
+ fWidth = 0;
}
}
} else {
diff --git a/xfa/fwl/basewidget/fwl_scrollbarimp.cpp b/xfa/fwl/basewidget/fwl_scrollbarimp.cpp
index 15b1d911b5..7e68ea2272 100644
--- a/xfa/fwl/basewidget/fwl_scrollbarimp.cpp
+++ b/xfa/fwl/basewidget/fwl_scrollbarimp.cpp
@@ -318,43 +318,26 @@ void CFWL_ScrollBarImp::CalcButtonLen() {
}
}
void CFWL_ScrollBarImp::CalcMinButtonRect(CFX_RectF& rect) {
- if (m_bCustomLayout) {
- IFWL_ThemeProvider* pTheme = m_pProperties->m_pThemeProvider;
- CFWL_ThemePart pPart;
- pPart.m_rtPart = m_rtMinBtn;
- pPart.m_pWidget = m_pInterface;
- pPart.m_iPart = CFWL_Part::ForeArrow;
- pPart.m_dwStates = (m_pProperties->m_dwStates & FWL_WGTSTATE_Disabled)
- ? CFWL_PartState_Disabled
- : m_iMinButtonState;
- pTheme->GetPartRect(&pPart, rect);
- } else {
- rect.left = m_rtClient.left;
- rect.top = m_rtClient.top;
- rect.width = IsVertical() ? m_rtClient.width : m_fButtonLen;
- rect.height = IsVertical() ? m_fButtonLen : m_rtClient.height;
- }
+ if (m_bCustomLayout)
+ return;
+
+ rect.left = m_rtClient.left;
+ rect.top = m_rtClient.top;
+ rect.width = IsVertical() ? m_rtClient.width : m_fButtonLen;
+ rect.height = IsVertical() ? m_fButtonLen : m_rtClient.height;
}
+
void CFWL_ScrollBarImp::CalcMaxButtonRect(CFX_RectF& rect) {
- if (m_bCustomLayout) {
- IFWL_ThemeProvider* pTheme = m_pProperties->m_pThemeProvider;
- CFWL_ThemePart pPart;
- pPart.m_rtPart = m_rtMaxBtn;
- pPart.m_pWidget = m_pInterface;
- pPart.m_iPart = CFWL_Part::BackArrow;
- pPart.m_dwStates = (m_pProperties->m_dwStates & FWL_WGTSTATE_Disabled)
- ? CFWL_PartState_Disabled
- : m_iMaxButtonState;
- pTheme->GetPartRect(&pPart, rect);
- } else {
- rect.left =
- IsVertical() ? m_rtClient.left : m_rtClient.right() - m_fButtonLen;
- rect.top =
- IsVertical() ? m_rtClient.bottom() - m_fButtonLen : m_rtClient.top;
- rect.width = IsVertical() ? m_rtClient.width : m_fButtonLen;
- rect.height = IsVertical() ? m_fButtonLen : m_rtClient.height;
- }
+ if (m_bCustomLayout)
+ return;
+
+ rect.left =
+ IsVertical() ? m_rtClient.left : m_rtClient.right() - m_fButtonLen;
+ rect.top = IsVertical() ? m_rtClient.bottom() - m_fButtonLen : m_rtClient.top;
+ rect.width = IsVertical() ? m_rtClient.width : m_fButtonLen;
+ rect.height = IsVertical() ? m_fButtonLen : m_rtClient.height;
}
+
void CFWL_ScrollBarImp::CalcThumbButtonRect(CFX_RectF& rect) {
if (!IsEnabled()) {
m_rtThumb.Reset();