diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-02-15 09:07:36 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-02-15 09:07:36 +0200 |
commit | fdc970ef3aeae9e0b86d32c8a131e14995ca188c (patch) | |
tree | be83f1544e4cafb6fb4f9641a240432844898fdf /sd | |
parent | 0ce9363dae0c1e326942b8df63e2b1cc30b04603 (diff) |
convert FocusMoveDirection to scoped enum
and drop unused NONE enumerator
Change-Id: I793acf12ad25517a4d5fa6f886225b589d87176d
Diffstat (limited to 'sd')
3 files changed, 15 insertions, 21 deletions
diff --git a/sd/source/ui/slidesorter/controller/SlsFocusManager.cxx b/sd/source/ui/slidesorter/controller/SlsFocusManager.cxx index 385246228ffb..3ee0bb0677d0 100644 --- a/sd/source/ui/slidesorter/controller/SlsFocusManager.cxx +++ b/sd/source/ui/slidesorter/controller/SlsFocusManager.cxx @@ -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) diff --git a/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx b/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx index fa63b447feb6..8d17378c7122 100644 --- a/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx +++ b/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx @@ -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; diff --git a/sd/source/ui/slidesorter/inc/controller/SlsFocusManager.hxx b/sd/source/ui/slidesorter/inc/controller/SlsFocusManager.hxx index 5572ca2e835f..18a1b2e8215f 100644 --- a/sd/source/ui/slidesorter/inc/controller/SlsFocusManager.hxx +++ b/sd/source/ui/slidesorter/inc/controller/SlsFocusManager.hxx @@ -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); |