summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2022-11-23 16:16:05 +0000
committerCaolán McNamara <caolanm@redhat.com>2022-11-23 20:45:47 +0100
commit27c44ebd3c93c2a37f50bfa7e42caa9ecf825cc9 (patch)
tree990980a01fe63b221e3bf7095d564d9f6257fcff /sd
parent5b3b13ceed474873776464269c5d71544252a928 (diff)
Resolves: tdf#145491 make sure focused page is selected after undo/redo
Change-Id: I269315556624c48373815640605a93c91a4c9819 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143184 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sd')
-rw-r--r--sd/source/ui/slidesorter/controller/SlsSelectionObserver.cxx12
1 files changed, 9 insertions, 3 deletions
diff --git a/sd/source/ui/slidesorter/controller/SlsSelectionObserver.cxx b/sd/source/ui/slidesorter/controller/SlsSelectionObserver.cxx
index 4f733dc5c9c6..8fb0493a0b98 100644
--- a/sd/source/ui/slidesorter/controller/SlsSelectionObserver.cxx
+++ b/sd/source/ui/slidesorter/controller/SlsSelectionObserver.cxx
@@ -121,11 +121,17 @@ void SelectionObserver::EndObservation()
}
aUpdateLock.Release();
- bool bSuccess = mrSlideSorter.GetController().GetFocusManager().SetFocusedPageToCurrentPage();
+ FocusManager& rFocusManager = mrSlideSorter.GetController().GetFocusManager();
+ bool bSuccess = rFocusManager.SetFocusedPageToCurrentPage();
// tdf#129346 nothing currently selected, select something, if possible
// but (tdf#129346) only if setting focus to current page failed
- if (!bSuccess && rSelector.GetPageCount() && rSelector.GetSelectedPageCount() == 0)
- rSelector.SelectPage(0);
+ if (rSelector.GetPageCount() && rSelector.GetSelectedPageCount() == 0)
+ {
+ if (bSuccess)
+ rSelector.SelectPage(rFocusManager.GetFocusedPageDescriptor());
+ else
+ rSelector.SelectPage(0);
+ }
}
} // end of namespace ::sd::slidesorter::controller