summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordsinclair <dsinclair@chromium.org>2016-11-17 09:50:40 -0800
committerCommit bot <commit-bot@chromium.org>2016-11-17 09:50:40 -0800
commite7798055382d2694e2ce78e5330af20c741d0a84 (patch)
tree5e87aa79f3eff650163f217839d14026b70d25a0
parenta43715b4cefc982baadd45510db8c4e428c2c8cd (diff)
downloadpdfium-e7798055382d2694e2ce78e5330af20c741d0a84.tar.xz
Convert CFWL_EvtSpbClick to CFWL_EvtClick
The m_bUp flag of CFWL_EvtSpbClick is never used after being set. Remove the flag and replace CFWL_EvtSpbClick with CFWL_EvtClick. Review-Url: https://codereview.chromium.org/2511803002
-rw-r--r--xfa/fwl/core/ifwl_spinbutton.cpp13
-rw-r--r--xfa/fwl/core/ifwl_spinbutton.h2
2 files changed, 7 insertions, 8 deletions
diff --git a/xfa/fwl/core/ifwl_spinbutton.cpp b/xfa/fwl/core/ifwl_spinbutton.cpp
index f3b8e486a8..7ca3ce9135 100644
--- a/xfa/fwl/core/ifwl_spinbutton.cpp
+++ b/xfa/fwl/core/ifwl_spinbutton.cpp
@@ -7,6 +7,7 @@
#include "xfa/fwl/core/ifwl_spinbutton.h"
#include "third_party/base/ptr_util.h"
+#include "xfa/fwl/core/cfwl_evtclick.h"
#include "xfa/fwl/core/cfwl_msgkey.h"
#include "xfa/fwl/core/cfwl_msgmouse.h"
#include "xfa/fwl/core/cfwl_themebackground.h"
@@ -236,10 +237,11 @@ void IFWL_SpinButton::OnLButtonDown(CFWL_MsgMouse* pMsg) {
m_iButtonIndex = 1;
m_dwDnState = CFWL_PartState_Pressed;
}
- CFWL_EvtSpbClick wmPosChanged;
+
+ CFWL_EvtClick wmPosChanged;
wmPosChanged.m_pSrcTarget = this;
- wmPosChanged.m_bUp = bUpPress;
DispatchEvent(&wmPosChanged);
+
Repaint(bUpPress ? &m_rtUpButton : &m_rtDnButton);
m_pTimerInfo = m_Timer.StartTimer(kElapseTime, true);
}
@@ -363,10 +365,10 @@ void IFWL_SpinButton::OnKeyDown(CFWL_MsgKey* pMsg) {
if (!bUpEnable && !bDownEnable)
return;
- CFWL_EvtSpbClick wmPosChanged;
+ CFWL_EvtClick wmPosChanged;
wmPosChanged.m_pSrcTarget = this;
- wmPosChanged.m_bUp = bUpEnable;
DispatchEvent(&wmPosChanged);
+
Repaint(bUpEnable ? &m_rtUpButton : &m_rtDnButton);
}
@@ -379,8 +381,7 @@ void IFWL_SpinButton::Timer::Run(IFWL_TimerInfo* pTimerInfo) {
if (!pButton->m_pTimerInfo)
return;
- CFWL_EvtSpbClick wmPosChanged;
+ CFWL_EvtClick wmPosChanged;
wmPosChanged.m_pSrcTarget = pButton;
- wmPosChanged.m_bUp = pButton->m_iButtonIndex == 0;
pButton->DispatchEvent(&wmPosChanged);
}
diff --git a/xfa/fwl/core/ifwl_spinbutton.h b/xfa/fwl/core/ifwl_spinbutton.h
index 39aee9fabe..e2fda86da0 100644
--- a/xfa/fwl/core/ifwl_spinbutton.h
+++ b/xfa/fwl/core/ifwl_spinbutton.h
@@ -17,8 +17,6 @@
class CFWL_MsgMouse;
class CFWL_WidgetProperties;
-FWL_EVENT_DEF(CFWL_EvtSpbClick, CFWL_EventType::Click, bool m_bUp;)
-
class IFWL_SpinButton : public IFWL_Widget {
public:
IFWL_SpinButton(const IFWL_App* app,