summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorMichael Weghorn <m.weghorn@posteo.de>2023-04-02 00:01:10 +0300
committerMichael Weghorn <m.weghorn@posteo.de>2023-04-03 17:01:31 +0200
commitbb4aaa4cfd6cf3fe0f43baae2622df1098047123 (patch)
tree57ce6adae30d72650ae1a686cf744828436708b3 /svx
parentfa7fc141e49bf1a5e1fc30645d559c19205d76a7 (diff)
Pass special char dlg context menu pos as param, drop member
The `maPosition` member was only used for the position of the context menu. It was set before calling `SvxShowCharSet::createContextMenu` and then only used in there. Pass the position directly as a parameter instead and drop the extra member. Change-Id: I7ba9ec60ffb993ca1269d86efeddbe0950ed7fbe Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149926 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/dialog/charmap.cxx8
1 files changed, 3 insertions, 5 deletions
diff --git a/svx/source/dialog/charmap.cxx b/svx/source/dialog/charmap.cxx
index 90bb03081af9..27fa8ccb2687 100644
--- a/svx/source/dialog/charmap.cxx
+++ b/svx/source/dialog/charmap.cxx
@@ -68,7 +68,6 @@ SvxShowCharSet::SvxShowCharSet(std::unique_ptr<weld::ScrolledWindow> pScrolledWi
, nX(0)
, nY(0)
, maFontSize(0, 0)
- , maPosition(0,0)
, mbRecalculateFont(true)
, mbUpdateForeground(true)
, mbUpdateBackground(true)
@@ -141,11 +140,10 @@ bool SvxShowCharSet::MouseButtonDown(const MouseEvent& rMEvt)
if (rMEvt.IsRight())
{
Point aPosition (rMEvt.GetPosPixel());
- maPosition = aPosition;
int nIndex = PixelToMapIndex( rMEvt.GetPosPixel() );
// Fire the focus event
SelectIndex( nIndex, true);
- createContextMenu();
+ createContextMenu(aPosition);
}
return true;
@@ -221,7 +219,7 @@ bool SvxShowCharSet::isFavChar(const OUString& sTitle, const OUString& rFont)
return isFavCharTitleExists && isFavCharFontExists;
}
-void SvxShowCharSet::createContextMenu()
+void SvxShowCharSet::createContextMenu(const Point& rPosition)
{
std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetDrawingArea(), "svx/ui/charsetmenu.ui"));
std::unique_ptr<weld::Menu> xItemMenu(xBuilder->weld_menu("charsetmenu"));
@@ -233,7 +231,7 @@ void SvxShowCharSet::createContextMenu()
else
xItemMenu->set_visible("remove", false);
- ContextMenuSelect(xItemMenu->popup_at_rect(GetDrawingArea(), tools::Rectangle(maPosition, Size(1,1))));
+ ContextMenuSelect(xItemMenu->popup_at_rect(GetDrawingArea(), tools::Rectangle(rPosition, Size(1,1))));
GrabFocus();
Invalidate();
}