summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorAndrzej J.R. Hunt <andrzej@ahunt.org>2013-10-26 17:10:52 +0100
committerCaolán McNamara <caolanm@redhat.com>2013-11-08 10:25:49 -0600
commit61a20e43b1ec7641bed073244c988e3ea981f086 (patch)
treef194cd32ad962d4970efea7cec8ca678b5a59f77 /sd
parentffbad093368fc307ddeb128c6654d67f967f2c9f (diff)
SlideSorter: insert new slide on double-click.
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 <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sd')
-rw-r--r--sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx21
1 files changed, 21 insertions, 0 deletions
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<InsertionIndicatorHandler> 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;
}