summaryrefslogtreecommitdiff
path: root/chart2
diff options
context:
space:
mode:
Diffstat (limited to 'chart2')
-rw-r--r--chart2/source/controller/main/ChartController_Window.cxx14
1 files changed, 14 insertions, 0 deletions
diff --git a/chart2/source/controller/main/ChartController_Window.cxx b/chart2/source/controller/main/ChartController_Window.cxx
index f3cd46bb5ee1..9c3993095e47 100644
--- a/chart2/source/controller/main/ChartController_Window.cxx
+++ b/chart2/source/controller/main/ChartController_Window.cxx
@@ -66,6 +66,7 @@
#include <toolkit/awt/vclxmenu.hxx>
#include <sfx2/viewsh.hxx>
+#include <sfx2/ipclient.hxx>
#include <svx/svxids.hrc>
#include <svx/ActionDescriptionProvider.hxx>
#include <svx/obj3d.hxx>
@@ -1259,6 +1260,19 @@ void ChartController::execute_Command( const CommandEvent& rCEvt )
{
PopupMenu* pPopupMenu = static_cast<PopupMenu*>(VCLXMenu::GetImplementation(xPopupMenu)->GetMenu());
pPopupMenu->SetLOKNotifier(SfxViewShell::Current());
+
+ // the context menu expects a position related to the document window,
+ // not to the chart window
+ SfxInPlaceClient* pIPClient = SfxViewShell::Current()->GetIPClient();
+ if (pIPClient)
+ {
+ vcl::Window* pRootWin = pIPClient->GetEditWin();
+ if (pRootWin)
+ {
+ Point aOffset = pChartWindow->GetOffsetPixelFrom(*pRootWin);
+ aPos += aOffset;
+ }
+ }
}
xPopupController->setPopupMenu( xPopupMenu );