summaryrefslogtreecommitdiff
path: root/xfa/fwl/core/ifwl_listbox.cpp
diff options
context:
space:
mode:
authordsinclair <dsinclair@chromium.org>2016-11-10 11:01:16 -0800
committerCommit bot <commit-bot@chromium.org>2016-11-10 11:01:16 -0800
commit3e577c2660c89646b56753839c1ec59c3ad187f4 (patch)
tree9b35b8cedcc885230ec521473ef2a3c9b5aaa6c6 /xfa/fwl/core/ifwl_listbox.cpp
parentf3480661a20c259581e7c100b0d5d06950a9559b (diff)
downloadpdfium-3e577c2660c89646b56753839c1ec59c3ad187f4.tar.xz
Convert FWL_SCBCODE to an enum class
This Cl changes the enum into an enum class and updates calling code to pass the enum instead of a uint32_t Review-Url: https://codereview.chromium.org/2482253004
Diffstat (limited to 'xfa/fwl/core/ifwl_listbox.cpp')
-rw-r--r--xfa/fwl/core/ifwl_listbox.cpp21
1 files changed, 11 insertions, 10 deletions
diff --git a/xfa/fwl/core/ifwl_listbox.cpp b/xfa/fwl/core/ifwl_listbox.cpp
index d52e8b1c8c..9a713c09cd 100644
--- a/xfa/fwl/core/ifwl_listbox.cpp
+++ b/xfa/fwl/core/ifwl_listbox.cpp
@@ -1089,49 +1089,50 @@ void IFWL_ListBox::OnVK(CFWL_ListItem* pItem, bool bShift, bool bCtrl) {
}
bool IFWL_ListBox::OnScroll(IFWL_ScrollBar* pScrollBar,
- uint32_t dwCode,
+ FWL_SCBCODE dwCode,
FX_FLOAT fPos) {
CFX_SizeF fs;
pScrollBar->GetRange(&fs.x, &fs.y);
FX_FLOAT iCurPos = pScrollBar->GetPos();
FX_FLOAT fStep = pScrollBar->GetStepSize();
switch (dwCode) {
- case FWL_SCBCODE_Min: {
+ case FWL_SCBCODE::Min: {
fPos = fs.x;
break;
}
- case FWL_SCBCODE_Max: {
+ case FWL_SCBCODE::Max: {
fPos = fs.y;
break;
}
- case FWL_SCBCODE_StepBackward: {
+ case FWL_SCBCODE::StepBackward: {
fPos -= fStep;
if (fPos < fs.x + fStep / 2)
fPos = fs.x;
break;
}
- case FWL_SCBCODE_StepForward: {
+ case FWL_SCBCODE::StepForward: {
fPos += fStep;
if (fPos > fs.y - fStep / 2)
fPos = fs.y;
break;
}
- case FWL_SCBCODE_PageBackward: {
+ case FWL_SCBCODE::PageBackward: {
fPos -= pScrollBar->GetPageSize();
if (fPos < fs.x)
fPos = fs.x;
break;
}
- case FWL_SCBCODE_PageForward: {
+ case FWL_SCBCODE::PageForward: {
fPos += pScrollBar->GetPageSize();
if (fPos > fs.y)
fPos = fs.y;
break;
}
- case FWL_SCBCODE_Pos:
- case FWL_SCBCODE_TrackPos:
+ case FWL_SCBCODE::Pos:
+ case FWL_SCBCODE::TrackPos:
+ case FWL_SCBCODE::None:
break;
- case FWL_SCBCODE_EndScroll:
+ case FWL_SCBCODE::EndScroll:
return false;
}
if (iCurPos != fPos) {