[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - sd/source

Xisco Fauli (via logerrit) logerrit at kemper.freedesktop.org
Sat Jan 30 19:17:38 UTC 2021


 sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx |    5 +++++
 1 file changed, 5 insertions(+)

New commits:
commit d71f7138d664b62604a4e4e7fc6e1b1073df1899
Author:     Xisco Fauli <xiscofauli at libreoffice.org>
AuthorDate: Fri Jan 29 12:42:09 2021 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Sat Jan 30 20:17:01 2021 +0100

    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/+/110142
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx b/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx
index 028d8f2a4266..2cfbddcaa998 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;
 


More information about the Libreoffice-commits mailing list