summaryrefslogtreecommitdiff
path: root/xfa/fwl/cfwl_listbox.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-02-07 16:36:39 -0500
committerChromium commit bot <commit-bot@chromium.org>2017-02-08 01:36:02 +0000
commitbba2a7cf30da9e84bcc14ef32dbb0bb944229219 (patch)
tree94a74de8d07b3e395bf6e08a62811a3a0d652d19 /xfa/fwl/cfwl_listbox.cpp
parent55e026b7b6eec17b012c819c4a7d39e63094b5c4 (diff)
downloadpdfium-bba2a7cf30da9e84bcc14ef32dbb0bb944229219.tar.xz
Update to use CFX_Rect{F} and CFX_Matrix constructors.
This Cl updates the code to use the constructors instead of creating an empty object and calling Set(). It also removes the various memsets of the CFX_Rect{F} classes. Change-Id: I6e20cec00866a38372858dcba5a30d31103172e4 Reviewed-on: https://pdfium-review.googlesource.com/2550 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'xfa/fwl/cfwl_listbox.cpp')
-rw-r--r--xfa/fwl/cfwl_listbox.cpp28
1 files changed, 12 insertions, 16 deletions
diff --git a/xfa/fwl/cfwl_listbox.cpp b/xfa/fwl/cfwl_listbox.cpp
index a7a568cd14..14d9886480 100644
--- a/xfa/fwl/cfwl_listbox.cpp
+++ b/xfa/fwl/cfwl_listbox.cpp
@@ -475,7 +475,6 @@ CFX_SizeF CFWL_ListBox::CalcSize(bool bAutoSize) {
m_rtClient = GetClientRect();
m_rtConent = m_rtClient;
CFX_RectF rtUIMargin;
- rtUIMargin.Set(0, 0, 0, 0);
if (!m_pOuter) {
CFWL_ThemePart part;
part.m_pWidget = this;
@@ -514,9 +513,9 @@ CFX_SizeF CFWL_ListBox::CalcSize(bool bAutoSize) {
if (!m_pVertScrollBar)
InitVerticalScrollBar();
- CFX_RectF rtScrollBar;
- rtScrollBar.Set(m_rtClient.right() - m_fScorllBarWidth, m_rtClient.top,
- m_fScorllBarWidth, m_rtClient.height - 1);
+ CFX_RectF rtScrollBar(m_rtClient.right() - m_fScorllBarWidth,
+ m_rtClient.top, m_fScorllBarWidth,
+ m_rtClient.height - 1);
if (bShowHorzScr)
rtScrollBar.height -= m_fScorllBarWidth;
@@ -547,9 +546,9 @@ CFX_SizeF CFWL_ListBox::CalcSize(bool bAutoSize) {
if (!m_pHorzScrollBar)
InitHorizontalScrollBar();
- CFX_RectF rtScrollBar;
- rtScrollBar.Set(m_rtClient.left, m_rtClient.bottom() - m_fScorllBarWidth,
- m_rtClient.width, m_fScorllBarWidth);
+ CFX_RectF rtScrollBar(m_rtClient.left,
+ m_rtClient.bottom() - m_fScorllBarWidth,
+ m_rtClient.width, m_fScorllBarWidth);
if (bShowVertScr)
rtScrollBar.width -= m_fScorllBarWidth;
@@ -575,9 +574,9 @@ CFX_SizeF CFWL_ListBox::CalcSize(bool bAutoSize) {
m_pHorzScrollBar->SetStates(FWL_WGTSTATE_Invisible);
}
if (bShowVertScr && bShowHorzScr) {
- m_rtStatic.Set(m_rtClient.right() - m_fScorllBarWidth,
- m_rtClient.bottom() - m_fScorllBarWidth, m_fScorllBarWidth,
- m_fScorllBarWidth);
+ m_rtStatic = CFX_RectF(m_rtClient.right() - m_fScorllBarWidth,
+ m_rtClient.bottom() - m_fScorllBarWidth,
+ m_fScorllBarWidth, m_fScorllBarWidth);
}
return fs;
}
@@ -588,8 +587,7 @@ void CFWL_ListBox::UpdateItemSize(CFWL_ListItem* pItem,
FX_FLOAT fItemHeight,
bool bAutoSize) const {
if (!bAutoSize && pItem) {
- CFX_RectF rtItem;
- rtItem.Set(0, size.y, fWidth, fItemHeight);
+ CFX_RectF rtItem(0, size.y, fWidth, fItemHeight);
pItem->SetRect(rtItem);
}
size.x = fWidth;
@@ -833,10 +831,8 @@ void CFWL_ListBox::OnVK(CFWL_ListItem* pItem, bool bShift, bool bCtrl) {
SetFocusItem(pItem);
ScrollToVisible(pItem);
- CFX_RectF rtInvalidate;
- rtInvalidate.Set(0, 0, m_pProperties->m_rtWidget.width,
- m_pProperties->m_rtWidget.height);
- RepaintRect(rtInvalidate);
+ RepaintRect(CFX_RectF(0, 0, m_pProperties->m_rtWidget.width,
+ m_pProperties->m_rtWidget.height));
}
bool CFWL_ListBox::OnScroll(CFWL_ScrollBar* pScrollBar,