summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorMichael Weghorn <m.weghorn@posteo.de>2023-04-22 23:28:58 +0300
committerMichael Weghorn <m.weghorn@posteo.de>2023-04-23 06:19:58 +0200
commitda4c97968080707c91a15f53d07e6d062977b19a (patch)
treea56ee032ee999113570b0b41122ef135cab6dbc2 /sfx2
parentdeb1a14adb115710b5e40dd305dc5da4a4e3b065 (diff)
sfx2: Pass SvxCharView context menu pos as param
... and drop the `maPosition` member that was used for that purpose only. Change-Id: If449a12e6e8e37c28d7b2b139e20c4c307d41eb8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150814 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/control/charwin.cxx9
1 files changed, 3 insertions, 6 deletions
diff --git a/sfx2/source/control/charwin.cxx b/sfx2/source/control/charwin.cxx
index f0c687082c9a..f80bd30b684d 100644
--- a/sfx2/source/control/charwin.cxx
+++ b/sfx2/source/control/charwin.cxx
@@ -33,7 +33,6 @@ using namespace com::sun::star;
SvxCharView::SvxCharView(const VclPtr<VirtualDevice>& rVirDev)
: mxVirDev(rVirDev)
, mnY(0)
- , maPosition(0, 0)
, maHasInsert(true)
{
}
@@ -70,11 +69,9 @@ bool SvxCharView::MouseButtonDown(const MouseEvent& rMEvt)
if (rMEvt.IsRight())
{
- Point aPosition(rMEvt.GetPosPixel());
- maPosition = aPosition;
GrabFocus();
Invalidate();
- createContextMenu();
+ createContextMenu(rMEvt.GetPosPixel());
}
return true;
@@ -107,14 +104,14 @@ void SvxCharView::InsertCharToDoc()
comphelper::dispatchCommand(".uno:InsertSymbol", aArgs);
}
-void SvxCharView::createContextMenu()
+void SvxCharView::createContextMenu(const Point& rPosition)
{
weld::DrawingArea* pDrawingArea = GetDrawingArea();
std::unique_ptr<weld::Builder> xBuilder(
Application::CreateBuilder(pDrawingArea, "sfx/ui/charviewmenu.ui"));
std::unique_ptr<weld::Menu> xItemMenu(xBuilder->weld_menu("charviewmenu"));
ContextMenuSelect(
- xItemMenu->popup_at_rect(pDrawingArea, tools::Rectangle(maPosition, Size(1, 1))));
+ xItemMenu->popup_at_rect(pDrawingArea, tools::Rectangle(rPosition, Size(1, 1))));
Invalidate();
}