diff options
Diffstat (limited to 'sd/source/ui/slidesorter/controller/SlsFocusManager.cxx')
-rw-r--r-- | sd/source/ui/slidesorter/controller/SlsFocusManager.cxx | 46 |
1 files changed, 3 insertions, 43 deletions
diff --git a/sd/source/ui/slidesorter/controller/SlsFocusManager.cxx b/sd/source/ui/slidesorter/controller/SlsFocusManager.cxx index 83e764b3ec66..385246228ffb 100644 --- a/sd/source/ui/slidesorter/controller/SlsFocusManager.cxx +++ b/sd/source/ui/slidesorter/controller/SlsFocusManager.cxx @@ -38,8 +38,7 @@ namespace sd { namespace slidesorter { namespace controller { FocusManager::FocusManager (SlideSorter& rSlideSorter) : mrSlideSorter(rSlideSorter), mnPageIndex(0), - mbPageIsFocused(false), - mbIsVerticalWrapActive(false) + mbPageIsFocused(false) { if (mrSlideSorter.GetModel().GetPageCount() > 0) mnPageIndex = 0; @@ -66,44 +65,17 @@ void FocusManager::MoveFocus (FocusMoveDirection eDirection) case FMD_LEFT: if (mnPageIndex > 0) mnPageIndex -= 1; - else if (mbIsVerticalWrapActive) - mnPageIndex = nPageCount-1; break; case FMD_RIGHT: if (mnPageIndex < nPageCount-1) mnPageIndex += 1; - else if (mbIsVerticalWrapActive) - mnPageIndex = 0; break; case FMD_UP: { const sal_Int32 nCandidate (mnPageIndex - nColumnCount); - if (nCandidate < 0) - { - if (mbIsVerticalWrapActive) - { - // Wrap around to the bottom row or the one above - // and go to the correct column. - const sal_Int32 nLastIndex (nPageCount-1); - const sal_Int32 nLastColumn (nLastIndex % nColumnCount); - const sal_Int32 nCurrentColumn (mnPageIndex%nColumnCount); - if (nLastColumn >= nCurrentColumn) - { - // The last row contains the current column. - mnPageIndex = nLastIndex - (nLastColumn-nCurrentColumn); - } - else - { - // Only the second to last row contains the current column. - mnPageIndex = nLastIndex - nLastColumn - - nColumnCount - + nCurrentColumn; - } - } - } - else + if (nCandidate >= 0) { // Move the focus the previous row. mnPageIndex = nCandidate; @@ -114,19 +86,7 @@ void FocusManager::MoveFocus (FocusMoveDirection eDirection) case FMD_DOWN: { const sal_Int32 nCandidate (mnPageIndex + nColumnCount); - if (nCandidate >= nPageCount) - { - if (mbIsVerticalWrapActive) - { - // Wrap around to the correct column. - mnPageIndex = mnPageIndex % nColumnCount; - } - else - { - // Do not move the focus. - } - } - else + if (nCandidate < nPageCount) { // Move the focus to the next row. mnPageIndex = nCandidate; |