dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx | 19 ++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-)
New commits: commit fc4d0639ee47776f1014d26ecfdcfb571cd73700 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Mon Dec 21 09:34:56 2020 +0000 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Mon Dec 21 21:59:31 2020 +0100 weld queryfuncmenu Change-Id: If6a92f846b00ec5bd719879c3f37290640e2d109 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108086 Tested-by: Caolán McNamara <caol...@redhat.com> Reviewed-by: Caolán McNamara <caol...@redhat.com> diff --git a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx index 38c51605a2e9..6e65bfc1781d 100644 --- a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx +++ b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx @@ -38,7 +38,6 @@ #include <strings.hxx> #include <helpids.h> #include "QTableWindow.hxx" -#include <vcl/menu.hxx> #include <vcl/weld.hxx> #include <vcl/settings.hxx> #include "QueryDesignFieldUndoAct.hxx" @@ -1961,16 +1960,16 @@ void OSelectionBrowseBox::Command(const CommandEvent& rEvt) { if (!static_cast<OQueryController&>(getDesignView()->getController()).isReadOnly()) { - VclBuilder aBuilder(nullptr, AllSettings::GetUIRootDir(), "dbaccess/ui/queryfuncmenu.ui", ""); - VclPtr<PopupMenu> aContextMenu(aBuilder.get_menu("menu")); - aContextMenu->CheckItem("functions", m_bVisibleRow[BROW_FUNCTION_ROW]); - aContextMenu->CheckItem("tablename", m_bVisibleRow[BROW_TABLE_ROW]); - aContextMenu->CheckItem("alias", m_bVisibleRow[BROW_COLUMNALIAS_ROW]); - aContextMenu->CheckItem("distinct", static_cast<OQueryController&>(getDesignView()->getController()).isDistinct()); - - aContextMenu->Execute(this, aMenuPos); + ::tools::Rectangle aRect(aMenuPos, Size(1, 1)); + weld::Window* pPopupParent = weld::GetPopupParent(*this, aRect); + std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(pPopupParent, "dbaccess/ui/queryfuncmenu.ui")); + std::unique_ptr<weld::Menu> xContextMenu(xBuilder->weld_menu("menu")); + xContextMenu->set_active("functions", m_bVisibleRow[BROW_FUNCTION_ROW]); + xContextMenu->set_active("tablename", m_bVisibleRow[BROW_TABLE_ROW]); + xContextMenu->set_active("alias", m_bVisibleRow[BROW_COLUMNALIAS_ROW]); + xContextMenu->set_active("distinct", static_cast<OQueryController&>(getDesignView()->getController()).isDistinct()); - OString sIdent = aContextMenu->GetCurItemIdent(); + OString sIdent = xContextMenu->popup_at_rect(pPopupParent, aRect); if (sIdent == "functions") { SetRowVisible(BROW_FUNCTION_ROW, !IsRowVisible(BROW_FUNCTION_ROW)); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits