summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-11-03 16:24:14 +0000
committerCaolán McNamara <caolanm@redhat.com>2017-11-04 00:42:24 +0100
commitd8f0e4144d51ff5709d005d289d71aa32f323913 (patch)
treec07b13c961538ad0635725677e21469f030d8376
parent5228db64eb9f55c945f1b460f2955fc3edfad791 (diff)
Resolves: rtl: tdf#60315 slide pane context menu misplaced
so use same (slighty crazed) logic as DrawViewShell::Command to get the right place when rtl is enabled Change-Id: Icb4a39310ab98bd186cbafd516ca5f323da8cce1 Reviewed-on: https://gerrit.libreoffice.org/44274 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--sd/source/ui/slidesorter/controller/SlideSorterController.cxx15
1 files changed, 5 insertions, 10 deletions
diff --git a/sd/source/ui/slidesorter/controller/SlideSorterController.cxx b/sd/source/ui/slidesorter/controller/SlideSorterController.cxx
index 9107111302e4..63056255ed1d 100644
--- a/sd/source/ui/slidesorter/controller/SlideSorterController.cxx
+++ b/sd/source/ui/slidesorter/controller/SlideSorterController.cxx
@@ -353,15 +353,7 @@ bool SlideSorterController::Command (
pWindow->ReleaseMouse();
Point aMenuLocation (0,0);
- if (rEvent.IsMouseEvent())
- {
- // We have to explicitly specify the location of the menu
- // when the slide sorter is placed in an undocked child
- // menu. But when it is docked it does not hurt, so we
- // specify the location always.
- aMenuLocation = rEvent.GetMousePosPixel();
- }
- else
+ if (!rEvent.IsMouseEvent())
{
// The event is not a mouse event. Use the center of the
// focused page as top left position of the context menu.
@@ -384,7 +376,10 @@ bool SlideSorterController::Command (
if (pDispatcher != nullptr)
{
mbContextMenuOpen = true;
- pDispatcher->ExecutePopup( aPopupId, pWindow, &aMenuLocation );
+ if (!rEvent.IsMouseEvent())
+ pDispatcher->ExecutePopup(aPopupId, pWindow, &aMenuLocation);
+ else
+ pDispatcher->ExecutePopup(aPopupId);
mbContextMenuOpen = false;
mrSlideSorter.GetView().UpdatePageUnderMouse();
::rtl::Reference<SelectionFunction> pFunction(GetCurrentSelectionFunction());