From da4c97968080707c91a15f53d07e6d062977b19a Mon Sep 17 00:00:00 2001 From: Michael Weghorn Date: Sat, 22 Apr 2023 23:28:58 +0300 Subject: 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 --- sfx2/source/control/charwin.cxx | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'sfx2') 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& 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 xBuilder( Application::CreateBuilder(pDrawingArea, "sfx/ui/charviewmenu.ui")); std::unique_ptr 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(); } -- cgit