From 61a20e43b1ec7641bed073244c988e3ea981f086 Mon Sep 17 00:00:00 2001 From: "Andrzej J.R. Hunt" Date: Sat, 26 Oct 2013 17:10:52 +0100 Subject: SlideSorter: insert new slide on double-click. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previously inserting a new slide required using a context menu (via right-click) or the main menu-bar. It is now possible to insert a blank slide by double-clicking in an empty area of the slide sorter. Change-Id: Id7ac5f9d3befd02d0a89ad5e1631885c0493ad3d Reviewed-on: https://gerrit.libreoffice.org/6442 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- .../slidesorter/controller/SlsSelectionFunction.cxx | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx b/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx index ee6c867abc62..746e940a361c 100644 --- a/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx +++ b/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx @@ -1275,6 +1275,27 @@ bool NormalModeHandler::ProcessButtonDownEvent ( DeselectAllPages(); break; + case BUTTON_DOWN | LEFT_BUTTON | DOUBLE_CLICK | NOT_OVER_PAGE: + { + // Insert a new slide: + // First of all we need to set the insertion indicator which sets the + // position where the new slide will be inserted. + ::boost::shared_ptr pInsertionIndicatorHandler + = mrSlideSorter.GetController().GetInsertionIndicatorHandler(); + + pInsertionIndicatorHandler->Start(false); + pInsertionIndicatorHandler->UpdatePosition( + rDescriptor.maMousePosition, + InsertionIndicatorHandler::MoveMode); + mrSlideSorter.GetController().GetSelectionManager()->SetInsertionPosition( + pInsertionIndicatorHandler->GetInsertionPageIndex()); + + mrSlideSorter.GetViewShell()->GetDispatcher()->Execute( + SID_INSERTPAGE, + SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD); + break; + } + default: return false; } -- cgit