summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2021-01-29 12:42:09 +0100
committerCaolán McNamara <caolanm@redhat.com>2021-01-31 17:56:49 +0100
commit54fc2ecba16d1dbf8183860289bb3ad61052c323 (patch)
tree7d4eaa4f22e4a8def3cb7a6910bbe7f74dab8481
parentUpdate git submodules (diff)
downloadcore-54fc2ecba16d1dbf8183860289bb3ad61052c323.tar.gz
core-54fc2ecba16d1dbf8183860289bb3ad61052c323.zip
tdf#139996: do not crash if no slide is selected
when no slide is selected, SyncPageSelectionToDocument(xSelection).first returns SAL_MAX_UINT16, which is greater than 0 Change-Id: I20225dc3c89a34358949f991d1548e11803c3131 Change-Id: I787d46ff97a6a1401c5bc4ffc136aefc4bbeea29 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110154 Tested-by: Jenkins Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit 3e1a46699e3b0868e2748f28e244b4d7de4fe775) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110143
-rw-r--r--sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx5
1 files changed, 5 insertions, 0 deletions
diff --git a/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx b/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx
index aae9af937627..8364e728c1e0 100644
--- a/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx
+++ b/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx
@@ -763,6 +763,11 @@ void SlideSorterViewShell::ExecMovePageUp (SfxRequest& /*rReq*/)
// SdDrawDocument MovePages is based on SdPage IsSelected, so
// transfer the SlideSorter selection to SdPages
sal_uInt16 firstSelectedPageNo = SyncPageSelectionToDocument(xSelection).first;
+
+ // In case no slide is selected
+ if (firstSelectedPageNo == SAL_MAX_UINT16)
+ return;
+
// Now compute human page number from internal page number
firstSelectedPageNo = (firstSelectedPageNo - 1) / 2;