From 3e078e17ee2144fb976a7e6b9227152113cea0d4 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 26 Mar 2019 16:27:17 +0000 Subject: weld SfxTemplateManagerDlg MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit like expert configuration change the gear menu not to display a down indicator and use CommandEvent to distinguish mouse/non-mouse context menus Change-Id: I64bb660a9c7dacb5b90b240d9d76d29324c5fd9f Reviewed-on: https://gerrit.libreoffice.org/69893 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- svx/source/dialog/charmap.cxx | 4 ++-- svx/source/tbxctrls/SvxPresetListBox.cxx | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'svx') diff --git a/svx/source/dialog/charmap.cxx b/svx/source/dialog/charmap.cxx index 50e1f5b12544..3834862f275e 100644 --- a/svx/source/dialog/charmap.cxx +++ b/svx/source/dialog/charmap.cxx @@ -239,9 +239,9 @@ void SvxShowCharSet::createContextMenu() sal_UCS4 cChar = GetSelectCharacter(); OUString aOUStr( &cChar, 1 ); if (isFavChar(aOUStr, mxVirDev->GetFont().GetFamilyName()) || maFavCharList.size() >= 16) - xItemMenu->show("add", false); + xItemMenu->set_visible("add", false); else - xItemMenu->show("remove", false); + xItemMenu->set_visible("remove", false); ContextMenuSelect(xItemMenu->popup_at_rect(GetDrawingArea(), tools::Rectangle(maPosition, Size(1,1)))); GrabFocus(); diff --git a/svx/source/tbxctrls/SvxPresetListBox.cxx b/svx/source/tbxctrls/SvxPresetListBox.cxx index fc3e18e8868d..2018b8a6fce4 100644 --- a/svx/source/tbxctrls/SvxPresetListBox.cxx +++ b/svx/source/tbxctrls/SvxPresetListBox.cxx @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -43,14 +44,14 @@ void SvxPresetListBox::Resize() SvtValueSet::Resize(); } -bool SvxPresetListBox::ContextMenu(const Point& rPos) +bool SvxPresetListBox::ContextMenu(const CommandEvent& rEvent) { const sal_uInt16 nIndex = GetSelectedItemId(); if(nIndex > 0) { std::unique_ptr xBuilder(Application::CreateBuilder(GetDrawingArea(), "svx/ui/presetmenu.ui")); std::unique_ptr xMenu(xBuilder->weld_menu("menu")); - OnMenuItemSelected(xMenu->popup_at_rect(GetDrawingArea(), tools::Rectangle(rPos, Size(1,1)))); + OnMenuItemSelected(xMenu->popup_at_rect(GetDrawingArea(), tools::Rectangle(rEvent.GetMousePosPixel(), Size(1,1)))); return true; } return false; -- cgit