convert FocusMoveDirection to scoped enum
and drop unused NONE enumerator Change-Id: I793acf12ad25517a4d5fa6f886225b589d87176d
This commit is contained in:
parent
0ce9363dae
commit
fdc970ef3a
@ -58,21 +58,17 @@ void FocusManager::MoveFocus (FocusMoveDirection eDirection)
|
||||
const sal_Int32 nPageCount (mrSlideSorter.GetModel().GetPageCount());
|
||||
switch (eDirection)
|
||||
{
|
||||
case FMD_NONE:
|
||||
// Nothing to be done.
|
||||
break;
|
||||
|
||||
case FMD_LEFT:
|
||||
case FocusMoveDirection::Left:
|
||||
if (mnPageIndex > 0)
|
||||
mnPageIndex -= 1;
|
||||
break;
|
||||
|
||||
case FMD_RIGHT:
|
||||
case FocusMoveDirection::Right:
|
||||
if (mnPageIndex < nPageCount-1)
|
||||
mnPageIndex += 1;
|
||||
break;
|
||||
|
||||
case FMD_UP:
|
||||
case FocusMoveDirection::Up:
|
||||
{
|
||||
const sal_Int32 nCandidate (mnPageIndex - nColumnCount);
|
||||
if (nCandidate >= 0)
|
||||
@ -83,7 +79,7 @@ void FocusManager::MoveFocus (FocusMoveDirection eDirection)
|
||||
}
|
||||
break;
|
||||
|
||||
case FMD_DOWN:
|
||||
case FocusMoveDirection::Down:
|
||||
{
|
||||
const sal_Int32 nCandidate (mnPageIndex + nColumnCount);
|
||||
if (nCandidate < nPageCount)
|
||||
|
@ -445,25 +445,25 @@ bool SelectionFunction::KeyInput (const KeyEvent& rEvent)
|
||||
|
||||
// Move the focus indicator left.
|
||||
case KEY_LEFT:
|
||||
MoveFocus(FocusManager::FMD_LEFT, rCode.IsShift(), rCode.IsMod1());
|
||||
MoveFocus(FocusManager::FocusMoveDirection::Left, rCode.IsShift(), rCode.IsMod1());
|
||||
bResult = true;
|
||||
break;
|
||||
|
||||
// Move the focus indicator right.
|
||||
case KEY_RIGHT:
|
||||
MoveFocus(FocusManager::FMD_RIGHT, rCode.IsShift(), rCode.IsMod1());
|
||||
MoveFocus(FocusManager::FocusMoveDirection::Right, rCode.IsShift(), rCode.IsMod1());
|
||||
bResult = true;
|
||||
break;
|
||||
|
||||
// Move the focus indicator up.
|
||||
case KEY_UP:
|
||||
MoveFocus(FocusManager::FMD_UP, rCode.IsShift(), rCode.IsMod1());
|
||||
MoveFocus(FocusManager::FocusMoveDirection::Up, rCode.IsShift(), rCode.IsMod1());
|
||||
bResult = true;
|
||||
break;
|
||||
|
||||
// Move the focus indicator down.
|
||||
case KEY_DOWN:
|
||||
MoveFocus(FocusManager::FMD_DOWN, rCode.IsShift(), rCode.IsMod1());
|
||||
MoveFocus(FocusManager::FocusMoveDirection::Down, rCode.IsShift(), rCode.IsMod1());
|
||||
bResult = true;
|
||||
break;
|
||||
|
||||
|
@ -49,13 +49,12 @@ public:
|
||||
|
||||
~FocusManager();
|
||||
|
||||
enum FocusMoveDirection
|
||||
enum class FocusMoveDirection
|
||||
{
|
||||
FMD_NONE,
|
||||
FMD_LEFT,
|
||||
FMD_RIGHT,
|
||||
FMD_UP,
|
||||
FMD_DOWN
|
||||
Left,
|
||||
Right,
|
||||
Up,
|
||||
Down
|
||||
};
|
||||
|
||||
/** Move the focus from the currently focused page to one that is
|
||||
@ -66,10 +65,9 @@ public:
|
||||
wrap around takes place in the same column, i.e. when you are
|
||||
in the top row and move up you come out in the bottom row in the
|
||||
same column. Horizontal wrap around moves to the next
|
||||
(FMD_RIGHT) or previous (FMD_LEFT) page. Moving to the right
|
||||
(FocusMoveDirection::Right) or previous (FocusMoveDirection::Left) page. Moving to the right
|
||||
from the last page goes to the first page and vice versa.
|
||||
When FMD_NONE is given, the current page index is checked for
|
||||
being valid. If it is not, then it is set to the nearest valid
|
||||
The current page index is set to the nearest valid
|
||||
page index.
|
||||
*/
|
||||
void MoveFocus (FocusMoveDirection eDirection);
|
||||
|
Loading…
x
Reference in New Issue
Block a user