Index: xfa/fwl/core/cfwl_combobox.cpp |
diff --git a/xfa/fwl/core/cfwl_combobox.cpp b/xfa/fwl/core/cfwl_combobox.cpp |
index 3c0337ed575b7586fec2d2bf3c1db0d510cddbb0..f33f682251dc39b46e527e8e450b3e22ce06da4f 100644 |
--- a/xfa/fwl/core/cfwl_combobox.cpp |
+++ b/xfa/fwl/core/cfwl_combobox.cpp |
@@ -72,15 +72,13 @@ FWL_Type CFWL_ComboBox::GetClassID() const { |
return FWL_Type::ComboBox; |
} |
-void CFWL_ComboBox::GetWidgetRect(CFX_RectF& rect, bool bAutoSize) { |
- if (!bAutoSize) { |
- rect = m_pProperties->m_rtWidget; |
- return; |
- } |
+CFX_RectF CFWL_ComboBox::GetWidgetRect(bool bAutoSize) { |
+ if (!bAutoSize) |
+ return m_pProperties->m_rtWidget; |
- rect.Reset(); |
+ CFX_RectF rect; |
if (IsDropDownStyle() && m_pEdit) { |
- m_pEdit->GetWidgetRect(rect, true); |
+ rect = m_pEdit->GetWidgetRect(true); |
} else { |
rect.width = 100; |
rect.height = 16; |
@@ -91,10 +89,11 @@ void CFWL_ComboBox::GetWidgetRect(CFX_RectF& rect, bool bAutoSize) { |
FX_FLOAT* pFWidth = static_cast<FX_FLOAT*>( |
GetThemeCapacity(CFWL_WidgetCapacity::ScrollBarWidth)); |
if (!pFWidth) |
- return; |
+ return rect; |
rect.Inflate(0, 0, *pFWidth, 0); |
InflateWidgetRect(rect); |
+ return rect; |
} |
void CFWL_ComboBox::AddString(const CFX_WideStringC& wsText) { |
@@ -320,8 +319,7 @@ CFX_RectF CFWL_ComboBox::GetBBox() const { |
if (!m_pListBox || !IsDropListVisible()) |
return rect; |
- CFX_RectF rtList; |
- m_pListBox->GetWidgetRect(rtList, false); |
+ CFX_RectF rtList = m_pListBox->GetWidgetRect(false); |
rtList.Offset(rect.left, rect.top); |
rect.Union(rtList); |
return rect; |
@@ -370,7 +368,7 @@ void CFWL_ComboBox::ShowDropList(bool bActivate) { |
uint32_t dwStyleAdd = m_pProperties->m_dwStyleExes & |
(FWL_STYLEEXT_CMB_Sort | FWL_STYLEEXT_CMB_OwnerDraw); |
m_pListBox->ModifyStylesEx(dwStyleAdd, 0); |
- m_pListBox->GetWidgetRect(m_rtList, true); |
+ m_rtList = m_pListBox->GetWidgetRect(true); |
CFX_RectF rtAnchor; |
rtAnchor.Set(0, 0, m_pProperties->m_rtWidget.width, |
@@ -646,8 +644,7 @@ void CFWL_ComboBox::DisForm_ShowDropList(bool bActivate) { |
m_pListBox->SetStates(FWL_WGTSTATE_Invisible); |
} |
- CFX_RectF rect; |
- m_pListBox->GetWidgetRect(rect, false); |
+ CFX_RectF rect = m_pListBox->GetWidgetRect(false); |
rect.Inflate(2, 2); |
Repaint(&rect); |
} |
@@ -688,7 +685,7 @@ FWL_WidgetHit CFWL_ComboBox::DisForm_HitTest(FX_FLOAT fx, FX_FLOAT fy) { |
if (m_rtBtn.Contains(fx, fy)) |
return FWL_WidgetHit::Client; |
if (DisForm_IsDropListVisible()) { |
- m_pListBox->GetWidgetRect(rect, false); |
+ rect = m_pListBox->GetWidgetRect(false); |
if (rect.Contains(fx, fy)) |
return FWL_WidgetHit::Client; |
} |
@@ -717,16 +714,14 @@ void CFWL_ComboBox::DisForm_DrawWidget(CFX_Graphics* pGraphics, |
pGraphics->RestoreGraphState(); |
if (m_pEdit) { |
- CFX_RectF rtEdit; |
- m_pEdit->GetWidgetRect(rtEdit, false); |
+ CFX_RectF rtEdit = m_pEdit->GetWidgetRect(false); |
CFX_Matrix mt; |
mt.Set(1, 0, 0, 1, rtEdit.left, rtEdit.top); |
mt.Concat(mtOrg); |
m_pEdit->DrawWidget(pGraphics, &mt); |
} |
if (m_pListBox && DisForm_IsDropListVisible()) { |
- CFX_RectF rtList; |
- m_pListBox->GetWidgetRect(rtList, false); |
+ CFX_RectF rtList = m_pListBox->GetWidgetRect(false); |
CFX_Matrix mt; |
mt.Set(1, 0, 0, 1, rtList.left, rtList.top); |
mt.Concat(mtOrg); |
@@ -739,8 +734,7 @@ CFX_RectF CFWL_ComboBox::DisForm_GetBBox() const { |
if (!m_pListBox || !DisForm_IsDropListVisible()) |
return rect; |
- CFX_RectF rtList; |
- m_pListBox->GetWidgetRect(rtList, false); |
+ CFX_RectF rtList = m_pListBox->GetWidgetRect(false); |
rtList.Offset(rect.left, rect.top); |
rect.Union(rtList); |
return rect; |