tdf#111737 - Add new (master) page depending on the edit mode

Change-Id: I5e0d0f604714cbc395cd6b0c7a9b5665f0d5f93b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157631
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
diff --git a/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx b/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx
index f8376ec..1af2abc 100644
--- a/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx
+++ b/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx
@@ -377,8 +377,11 @@ bool SelectionFunction::KeyInput (const KeyEvent& rEvent)
                }
                else if (pViewShell->GetDispatcher() != nullptr)
                {
                    // tdf#111737 - add new (master) page depending on the edit mode
                    pViewShell->GetDispatcher()->Execute(
                        SID_INSERTPAGE,
                        mrSlideSorter.GetModel().GetEditMode() == EditMode::Page
                            ? SID_INSERTPAGE
                            : SID_INSERT_MASTER_PAGE,
                        SfxCallMode::ASYNCHRON | SfxCallMode::RECORD);
                }
                bResult = true;