summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorFaisal M. Al-Otaibi <fmalotaibi@kacst.edu.sa>2013-02-03 08:17:01 +0300
committerNorbert Thiebaud <nthiebaud@gmail.com>2013-02-04 06:23:45 +0000
commit35a45a4508ca4156ebaa4f17df776a971084160d (patch)
treea7eddc1cf46c819c0ffe00f43fa19daaf59b571c /sd
parent7b235eec105c963173282e1e3f392c64b069902b (diff)
fdo#60213- fix the right-click misbehavior
Change-Id: Iea44c9e70efeb84482aefc70b311f1781241b030 Reviewed-on: https://gerrit.libreoffice.org/1971 Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com> Tested-by: Norbert Thiebaud <nthiebaud@gmail.com>
Diffstat (limited to 'sd')
-rw-r--r--sd/source/ui/toolpanel/LayoutMenu.cxx14
1 files changed, 8 insertions, 6 deletions
diff --git a/sd/source/ui/toolpanel/LayoutMenu.cxx b/sd/source/ui/toolpanel/LayoutMenu.cxx
index b602b2f2b574..24bcdc1d6284 100644
--- a/sd/source/ui/toolpanel/LayoutMenu.cxx
+++ b/sd/source/ui/toolpanel/LayoutMenu.cxx
@@ -857,13 +857,15 @@ void LayoutMenu::Command (const CommandEvent& rEvent)
{
if (GetShellManager() != NULL)
GetShellManager()->MoveToTop(this);
+ Point aPosition (0,0);
if (rEvent.IsMouseEvent())
{
// Do not show the context menu when the mouse was not
// pressed over an item.
+ // We have to explicitly specify the location of the menu
+ // when the LayoutMenu is undocked
if (GetItemId(rEvent.GetMousePosPixel()) > 0)
- mrBase.GetViewFrame()->GetDispatcher()->ExecutePopup(
- SdResId(RID_TASKPANE_LAYOUTMENU_POPUP));
+ aPosition = rEvent.GetMousePosPixel();
}
else
{
@@ -873,13 +875,13 @@ void LayoutMenu::Command (const CommandEvent& rEvent)
if (GetSelectItemId() != (sal_uInt16)-1)
{
Rectangle aBBox (GetItemRect(GetSelectItemId()));
- Point aPosition (aBBox.Center());
- mrBase.GetViewFrame()->GetDispatcher()->ExecutePopup(
+ aPosition = aBBox.Center();
+ }
+ }
+ mrBase.GetViewFrame()->GetDispatcher()->ExecutePopup(
SdResId(RID_TASKPANE_LAYOUTMENU_POPUP),
this,
&aPosition);
- }
- }
}
break;