basctl/source/basicide/bastype2.cxx | 2 basctl/source/basicide/macrodlg.cxx | 2 cui/source/customize/SvxMenuConfigPage.cxx | 4 cui/source/customize/SvxToolbarConfigPage.cxx | 4 cui/source/customize/cfgutil.cxx | 2 cui/source/dialogs/MacroManagerDialog.cxx | 2 cui/source/dialogs/about.cxx | 375 +++++++++--------- cui/source/inc/MacroManagerDialog.hxx | 4 cui/source/inc/cfgutil.hxx | 2 dbaccess/source/ui/control/dbtreelistbox.cxx | 2 dbaccess/source/ui/misc/WTypeSelect.cxx | 2 dbaccess/source/ui/querydesign/TableWindowListBox.cxx | 2 fpicker/source/office/fileview.cxx | 2 include/vcl/jsdialog/executor.hxx | 2 include/vcl/weld.hxx | 15 reportdesign/source/ui/dlg/Navigator.cxx | 2 sc/source/ui/cctrl/checklistmenu.cxx | 4 sc/source/ui/miscdlgs/acredlin.cxx | 2 sc/source/ui/navipi/content.cxx | 2 sc/source/ui/navipi/scenwnd.cxx | 2 sd/source/ui/animations/CustomAnimationList.cxx | 2 sd/source/ui/dlg/sdtreelb.cxx | 2 sfx2/source/appl/newhelp.cxx | 2 sfx2/source/control/templatedlglocalview.cxx | 2 sfx2/source/devtools/ObjectInspectorTreeHandler.cxx | 2 sfx2/source/dialog/StyleList.cxx | 4 solenv/clang-format/excludelist | 1 svx/source/form/datanavi.cxx | 2 svx/source/form/filtnav.cxx | 2 svx/source/form/navigatortree.cxx | 2 svx/source/gallery2/galbrws1.cxx | 4 sw/source/uibase/misc/redlndlg.cxx | 2 sw/source/uibase/utlui/content.cxx | 2 sw/source/uibase/utlui/glbltree.cxx | 2 vcl/qt5/QtInstanceTreeView.cxx | 2 vcl/source/app/salvtables.cxx | 2 vcl/unx/gtk3/gtkinst.cxx | 6 37 files changed, 241 insertions(+), 234 deletions(-)
New commits: commit 1143f72b8d1131b238f16527da8849cf14996f13 Author: Michael Weghorn <[email protected]> AuthorDate: Thu Dec 11 00:33:25 2025 +0100 Commit: Michael Weghorn <[email protected]> CommitDate: Fri Dec 12 13:25:54 2025 +0100 cui: clang-format cui/source/dialogs/about.cxx This in particular ensures the use of the usual 4 spaces for one indentation level, instead of 2. Change-Id: Ib4067e6a5ffe4d830a8eb55f2180ede7b28b3c9e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195416 Reviewed-by: Michael Weghorn <[email protected]> Tested-by: Jenkins diff --git a/cui/source/dialogs/about.cxx b/cui/source/dialogs/about.cxx index 2484940a92ed..51a57b8ec072 100644 --- a/cui/source/dialogs/about.cxx +++ b/cui/source/dialogs/about.cxx @@ -23,18 +23,18 @@ #include <about.hxx> -#include <osl/process.h> //osl_getProcessLocale +#include <osl/process.h> //osl_getProcessLocale #include <rtl/bootstrap.hxx> -#include <sal/log.hxx> //SAL_WARN -#include <vcl/graph.hxx> //Graphic -#include <vcl/settings.hxx> //GetSettings -#include <vcl/svapp.hxx> //Application:: +#include <sal/log.hxx> //SAL_WARN +#include <vcl/graph.hxx> //Graphic +#include <vcl/settings.hxx> //GetSettings +#include <vcl/svapp.hxx> //Application:: #include <vcl/weld.hxx> #include <unotools/resmgr.hxx> //Translate #include <config_buildid.h> //EXTRA_BUILDID #include <config_features.h> -#include <dialmgr.hxx> //CuiResId +#include <dialmgr.hxx> //CuiResId #include <i18nlangtag/languagetag.hxx> #include <sfx2/app.hxx> //SfxApplication::loadBrandSvg #include <strings.hrc> @@ -54,213 +54,228 @@ using namespace ::com::sun::star::uno; -AboutDialog::AboutDialog(weld::Window *pParent) - : GenericDialogController(pParent, u"cui/ui/aboutdialog.ui"_ustr, u"AboutDialog"_ustr), - m_pCreditsButton(m_xBuilder->weld_link_button(u"btnCredits"_ustr)), - m_pWebsiteButton(m_xBuilder->weld_link_button(u"btnWebsite"_ustr)), - m_pReleaseNotesButton(m_xBuilder->weld_link_button(u"btnReleaseNotes"_ustr)), - m_pCloseButton(m_xBuilder->weld_button(u"btnClose"_ustr)), - m_pCopyButton(m_xBuilder->weld_button(u"btnCopyVersion"_ustr)), - m_pBrandImage(m_xBuilder->weld_image(u"imBrand"_ustr)), - m_pAboutImage(m_xBuilder->weld_image(u"imAbout"_ustr)), - m_pVersionLabel(m_xBuilder->weld_label(u"lbVersionString"_ustr)), - m_pBuildCaption(m_xBuilder->weld_label(u"lbBuild"_ustr)), - m_pBuildLabel(m_xBuilder->weld_link_button(u"lbBuildString"_ustr)), - m_pEnvLabel(m_xBuilder->weld_label(u"lbEnvString"_ustr)), - m_pUILabel(m_xBuilder->weld_label(u"lbUIString"_ustr)), - m_pLocaleLabel(m_xBuilder->weld_label(u"lbLocaleString"_ustr)), - m_pMiscLabel(m_xBuilder->weld_label(u"lbMiscString"_ustr)), - m_pCopyrightLabel(m_xBuilder->weld_label(u"lbCopyright"_ustr)) { - - // Labels - m_pVersionLabel->set_label(GetVersionString()); - - OUString sbuildId = GetBuildString(); - if (IsStringValidGitHash(sbuildId)) { - const tools::Long nMaxChar = 25; - m_pBuildLabel->set_uri("https://git.libreoffice.org/core/history/" + sbuildId); - m_pBuildLabel->set_label(sbuildId.getLength() > nMaxChar ? sbuildId.replaceAt( - nMaxChar, sbuildId.getLength() - nMaxChar, u"...") - : sbuildId); - } else { - m_pBuildCaption->hide(); - m_pBuildLabel->hide(); - } - - m_pEnvLabel->set_label(Application::GetHWOSConfInfo(1)); - m_pUILabel->set_label(Application::GetHWOSConfInfo(2)); - m_pLocaleLabel->set_label(GetLocaleString()); - m_pMiscLabel->set_label(GetMiscString()); - m_pCopyrightLabel->set_label(GetCopyrightString()); - - // Images - const tools::Long nWidth(m_pCopyrightLabel->get_preferred_size().getWidth()); - Bitmap aBackgroundBitmap; - - if (SfxApplication::loadBrandSvg(Application::GetSettings() - .GetStyleSettings() - .GetDialogColor() - .IsDark() - ? u"shell/logo_inverted" - : u"shell/logo", - aBackgroundBitmap, nWidth * 0.8)) { - // Eliminate white background when Skia is disabled by not drawing the - // background bitmap to a VirtualDevice. On most platforms, non-Skia - // VirtualDevices will be filled with a solid color when drawing - // the bitmap. - Graphic aGraphic(aBackgroundBitmap); - m_pBrandImage->set_image(aGraphic.GetXGraphic()); - } - if (SfxApplication::loadBrandSvg(u"shell/about", aBackgroundBitmap, nWidth * 0.9)) { - // Eliminate white background when Skia is disabled by not drawing the - // background bitmap to a VirtualDevice. On most platforms, non-Skia - // VirtualDevices will be filled with a solid color when drawing - // the bitmap. - Graphic aGraphic(aBackgroundBitmap); - m_pAboutImage->set_image(aGraphic.GetXGraphic()); - } - - // Links - m_pCreditsButton->set_uri(officecfg::Office::Common::Menus::CreditsURL::get()); - - OUString sURL(officecfg::Office::Common::Help::StartCenter::InfoURL::get()); - localizeWebserviceURI(sURL); - m_pWebsiteButton->set_uri(sURL); - - // See also SID_WHATSNEW in sfx2/source/appl/appserv.cxx - sURL = officecfg::Office::Common::Menus::ReleaseNotesURL::get() + - "?LOvers=" + utl::ConfigManager::getProductVersion() + "&LOlocale=" + - LanguageTag(utl::ConfigManager::getUILocale()).getBcp47(); - m_pReleaseNotesButton->set_uri(sURL); - - // Handler - m_pCopyButton->connect_clicked(LINK(this, AboutDialog, HandleClick)); - m_pCloseButton->grab_focus(); +AboutDialog::AboutDialog(weld::Window* pParent) + : GenericDialogController(pParent, u"cui/ui/aboutdialog.ui"_ustr, u"AboutDialog"_ustr) + , m_pCreditsButton(m_xBuilder->weld_link_button(u"btnCredits"_ustr)) + , m_pWebsiteButton(m_xBuilder->weld_link_button(u"btnWebsite"_ustr)) + , m_pReleaseNotesButton(m_xBuilder->weld_link_button(u"btnReleaseNotes"_ustr)) + , m_pCloseButton(m_xBuilder->weld_button(u"btnClose"_ustr)) + , m_pCopyButton(m_xBuilder->weld_button(u"btnCopyVersion"_ustr)) + , m_pBrandImage(m_xBuilder->weld_image(u"imBrand"_ustr)) + , m_pAboutImage(m_xBuilder->weld_image(u"imAbout"_ustr)) + , m_pVersionLabel(m_xBuilder->weld_label(u"lbVersionString"_ustr)) + , m_pBuildCaption(m_xBuilder->weld_label(u"lbBuild"_ustr)) + , m_pBuildLabel(m_xBuilder->weld_link_button(u"lbBuildString"_ustr)) + , m_pEnvLabel(m_xBuilder->weld_label(u"lbEnvString"_ustr)) + , m_pUILabel(m_xBuilder->weld_label(u"lbUIString"_ustr)) + , m_pLocaleLabel(m_xBuilder->weld_label(u"lbLocaleString"_ustr)) + , m_pMiscLabel(m_xBuilder->weld_label(u"lbMiscString"_ustr)) + , m_pCopyrightLabel(m_xBuilder->weld_label(u"lbCopyright"_ustr)) +{ + // Labels + m_pVersionLabel->set_label(GetVersionString()); + + OUString sbuildId = GetBuildString(); + if (IsStringValidGitHash(sbuildId)) + { + const tools::Long nMaxChar = 25; + m_pBuildLabel->set_uri("https://git.libreoffice.org/core/history/" + sbuildId); + m_pBuildLabel->set_label( + sbuildId.getLength() > nMaxChar + ? sbuildId.replaceAt(nMaxChar, sbuildId.getLength() - nMaxChar, u"...") + : sbuildId); + } + else + { + m_pBuildCaption->hide(); + m_pBuildLabel->hide(); + } + + m_pEnvLabel->set_label(Application::GetHWOSConfInfo(1)); + m_pUILabel->set_label(Application::GetHWOSConfInfo(2)); + m_pLocaleLabel->set_label(GetLocaleString()); + m_pMiscLabel->set_label(GetMiscString()); + m_pCopyrightLabel->set_label(GetCopyrightString()); + + // Images + const tools::Long nWidth(m_pCopyrightLabel->get_preferred_size().getWidth()); + Bitmap aBackgroundBitmap; + + if (SfxApplication::loadBrandSvg( + Application::GetSettings().GetStyleSettings().GetDialogColor().IsDark() + ? u"shell/logo_inverted" + : u"shell/logo", + aBackgroundBitmap, nWidth * 0.8)) + { + // Eliminate white background when Skia is disabled by not drawing the + // background bitmap to a VirtualDevice. On most platforms, non-Skia + // VirtualDevices will be filled with a solid color when drawing + // the bitmap. + Graphic aGraphic(aBackgroundBitmap); + m_pBrandImage->set_image(aGraphic.GetXGraphic()); + } + if (SfxApplication::loadBrandSvg(u"shell/about", aBackgroundBitmap, nWidth * 0.9)) + { + // Eliminate white background when Skia is disabled by not drawing the + // background bitmap to a VirtualDevice. On most platforms, non-Skia + // VirtualDevices will be filled with a solid color when drawing + // the bitmap. + Graphic aGraphic(aBackgroundBitmap); + m_pAboutImage->set_image(aGraphic.GetXGraphic()); + } + + // Links + m_pCreditsButton->set_uri(officecfg::Office::Common::Menus::CreditsURL::get()); + + OUString sURL(officecfg::Office::Common::Help::StartCenter::InfoURL::get()); + localizeWebserviceURI(sURL); + m_pWebsiteButton->set_uri(sURL); + + // See also SID_WHATSNEW in sfx2/source/appl/appserv.cxx + sURL = officecfg::Office::Common::Menus::ReleaseNotesURL::get() + + "?LOvers=" + utl::ConfigManager::getProductVersion() + + "&LOlocale=" + LanguageTag(utl::ConfigManager::getUILocale()).getBcp47(); + m_pReleaseNotesButton->set_uri(sURL); + + // Handler + m_pCopyButton->connect_clicked(LINK(this, AboutDialog, HandleClick)); + m_pCloseButton->grab_focus(); } AboutDialog::~AboutDialog() {} -bool AboutDialog::IsStringValidGitHash(std::u16string_view hash) { - return std::all_of(hash.begin(), hash.end(), - [](auto &rSymbol) { return std::isxdigit(rSymbol); }); +bool AboutDialog::IsStringValidGitHash(std::u16string_view hash) +{ + return std::all_of(hash.begin(), hash.end(), + [](auto& rSymbol) { return std::isxdigit(rSymbol); }); } -OUString AboutDialog::GetVersionString() { - OUString arch; - auto const ok = rtl::Bootstrap::get(u"_ARCH"_ustr, arch); - assert(ok); (void) ok; - return CuiResId(TranslateId(nullptr, "%ABOUTBOXPRODUCTVERSION%ABOUTBOXPRODUCTVERSIONSUFFIX")) + " (" + arch + ")"; +OUString AboutDialog::GetVersionString() +{ + OUString arch; + auto const ok = rtl::Bootstrap::get(u"_ARCH"_ustr, arch); + assert(ok); + (void)ok; + return CuiResId(TranslateId(nullptr, "%ABOUTBOXPRODUCTVERSION%ABOUTBOXPRODUCTVERSIONSUFFIX")) + + " (" + arch + ")"; } OUString AboutDialog::GetBuildString() { - OUString sBuildId(utl::Bootstrap::getBuildIdData(u""_ustr)); - SAL_WARN_IF(sBuildId.isEmpty(), "cui.dialogs", "No BUILDID in bootstrap file"); + OUString sBuildId(utl::Bootstrap::getBuildIdData(u""_ustr)); + SAL_WARN_IF(sBuildId.isEmpty(), "cui.dialogs", "No BUILDID in bootstrap file"); - return sBuildId; + return sBuildId; } -OUString AboutDialog::GetLocaleString(const bool bLocalized) { - - OUString sLocaleStr; - - rtl_Locale *pLocale; - osl_getProcessLocale(&pLocale); - if (pLocale && pLocale->Language) { - if (pLocale->Country && rtl_uString_getLength(pLocale->Country) > 0) - sLocaleStr = OUString::unacquired(&pLocale->Language) + "_" + - OUString::unacquired(&pLocale->Country); +OUString AboutDialog::GetLocaleString(const bool bLocalized) +{ + OUString sLocaleStr; + + rtl_Locale* pLocale; + osl_getProcessLocale(&pLocale); + if (pLocale && pLocale->Language) + { + if (pLocale->Country && rtl_uString_getLength(pLocale->Country) > 0) + sLocaleStr = OUString::unacquired(&pLocale->Language) + "_" + + OUString::unacquired(&pLocale->Country); + else + sLocaleStr = OUString(pLocale->Language); + if (pLocale->Variant && rtl_uString_getLength(pLocale->Variant) > 0) + sLocaleStr += OUString(pLocale->Variant); + } + + sLocaleStr = Application::GetSettings().GetLanguageTag().getBcp47() + " (" + sLocaleStr + ")"; + + OUString aUILocaleStr = Application::GetSettings().GetUILanguageTag().getBcp47(); + OUString sUILocaleStr; + if (bLocalized) + sUILocaleStr = CuiResId(RID_CUISTR_ABOUT_UILOCALE); else - sLocaleStr = OUString(pLocale->Language); - if (pLocale->Variant && rtl_uString_getLength(pLocale->Variant) > 0) - sLocaleStr += OUString(pLocale->Variant); - } - - sLocaleStr = Application::GetSettings().GetLanguageTag().getBcp47() + " (" + - sLocaleStr + ")"; - - OUString aUILocaleStr = - Application::GetSettings().GetUILanguageTag().getBcp47(); - OUString sUILocaleStr; - if (bLocalized) - sUILocaleStr = CuiResId(RID_CUISTR_ABOUT_UILOCALE); - else - sUILocaleStr = Translate::get(RID_CUISTR_ABOUT_UILOCALE, Translate::Create("cui", LanguageTag(u"en-US"_ustr))); - - if (sUILocaleStr.indexOf("$LOCALE") == -1) { - SAL_WARN("cui.dialogs", "translated uilocale string in translations " - "doesn't contain $LOCALE placeholder"); - sUILocaleStr += " $LOCALE"; - } - sUILocaleStr = sUILocaleStr.replaceAll("$LOCALE", aUILocaleStr); - - return sLocaleStr + "; " + sUILocaleStr; + sUILocaleStr = Translate::get(RID_CUISTR_ABOUT_UILOCALE, + Translate::Create("cui", LanguageTag(u"en-US"_ustr))); + + if (sUILocaleStr.indexOf("$LOCALE") == -1) + { + SAL_WARN("cui.dialogs", "translated uilocale string in translations " + "doesn't contain $LOCALE placeholder"); + sUILocaleStr += " $LOCALE"; + } + sUILocaleStr = sUILocaleStr.replaceAll("$LOCALE", aUILocaleStr); + + return sLocaleStr + "; " + sUILocaleStr; } -OUString AboutDialog::GetMiscString() { - - OUString sMisc; +OUString AboutDialog::GetMiscString() +{ + OUString sMisc; - bool const extra = EXTRA_BUILDID[0] != ' - // extracted from the 'if' to avoid Clang -Wunreachable-code - if (extra) { - sMisc = EXTRA_BUILDID " "; - } + bool const extra = EXTRA_BUILDID[0] != ' + // extracted from the 'if' to avoid Clang -Wunreachable-code + if (extra) + { + sMisc = EXTRA_BUILDID " "; + } - OUString aCalcMode; // Calc calculation mode + OUString aCalcMode; // Calc calculation mode #if HAVE_FEATURE_OPENCL - if (openclwrapper::GPUEnv::isOpenCLEnabled()) - aCalcMode += " CL"; + if (openclwrapper::GPUEnv::isOpenCLEnabled()) + aCalcMode += " CL"; #endif - static const bool bThreadingProhibited = - std::getenv("SC_NO_THREADED_CALCULATION"); - bool bThreadedCalc = officecfg::Office::Calc::Formula::Calculation:: - UseThreadedCalculationForFormulaGroups::get(); + static const bool bThreadingProhibited = std::getenv("SC_NO_THREADED_CALCULATION"); + bool bThreadedCalc = officecfg::Office::Calc::Formula::Calculation:: + UseThreadedCalculationForFormulaGroups::get(); - if (!bThreadingProhibited && bThreadedCalc) { - aCalcMode += " threaded"; - } + if (!bThreadingProhibited && bThreadedCalc) + { + aCalcMode += " threaded"; + } - if (officecfg::Office::Calc::Defaults::Sheet::JumboSheets::get()) - { - aCalcMode += " Jumbo"; - } + if (officecfg::Office::Calc::Defaults::Sheet::JumboSheets::get()) + { + aCalcMode += " Jumbo"; + } - if (aCalcMode.isEmpty()) - aCalcMode = " default"; - sMisc += "Calc:" + aCalcMode; + if (aCalcMode.isEmpty()) + aCalcMode = " default"; + sMisc += "Calc:" + aCalcMode; - return sMisc; + return sMisc; } -OUString AboutDialog::GetCopyrightString() { - OUString sVendorTextStr(CuiResId(RID_CUISTR_ABOUT_VENDOR)); - OUString aCopyrightString = - sVendorTextStr + " " + CuiResId(RID_CUISTR_ABOUT_COPYRIGHT) + " "; +OUString AboutDialog::GetCopyrightString() +{ + OUString sVendorTextStr(CuiResId(RID_CUISTR_ABOUT_VENDOR)); + OUString aCopyrightString = sVendorTextStr + " " + CuiResId(RID_CUISTR_ABOUT_COPYRIGHT) + " "; - if (utl::ConfigManager::getProductName() == "LibreOffice") - aCopyrightString += CuiResId(RID_CUISTR_ABOUT_BASED_ON); - else - aCopyrightString += CuiResId(RID_CUISTR_ABOUT_DERIVED); + if (utl::ConfigManager::getProductName() == "LibreOffice") + aCopyrightString += CuiResId(RID_CUISTR_ABOUT_BASED_ON); + else + aCopyrightString += CuiResId(RID_CUISTR_ABOUT_DERIVED); - return aCopyrightString; + return aCopyrightString; } // special labels to comply with previous version info // untranslated English for QA -IMPL_LINK_NOARG(AboutDialog, HandleClick, weld::Button &, void) { - css::uno::Reference<css::datatransfer::clipboard::XClipboard> xClipboard = - css::datatransfer::clipboard::SystemClipboard::create( - comphelper::getProcessComponentContext()); - - OUString sInfo = "Version: " + m_pVersionLabel->get_label() + " " // version - "Build ID: " + GetBuildString() + " " + // build id - Application::GetHWOSConfInfo(0,false) + " " // env+UI - "Locale: " + GetLocaleString(false) + " " + // locale - GetMiscString(); // misc - - vcl::unohelper::TextDataObject::CopyStringTo(sInfo, xClipboard); +IMPL_LINK_NOARG(AboutDialog, HandleClick, weld::Button&, void) +{ + css::uno::Reference<css::datatransfer::clipboard::XClipboard> xClipboard + = css::datatransfer::clipboard::SystemClipboard::create( + comphelper::getProcessComponentContext()); + + OUString sInfo = "Version: " + m_pVersionLabel->get_label() + + " " // version + "Build ID: " + + GetBuildString() + " " + // build id + Application::GetHWOSConfInfo(0, false) + + " " // env+UI + "Locale: " + + GetLocaleString(false) + " " + // locale + GetMiscString(); // misc + + vcl::unohelper::TextDataObject::CopyStringTo(sInfo, xClipboard); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/solenv/clang-format/excludelist b/solenv/clang-format/excludelist index a7f8793d4cfc..60254fc0f7a2 100644 --- a/solenv/clang-format/excludelist +++ b/solenv/clang-format/excludelist @@ -2165,7 +2165,6 @@ cui/source/customize/macropg_impl.hxx cui/source/dialogs/DiagramDialog.cxx cui/source/dialogs/SpellAttrib.hxx cui/source/dialogs/SpellDialog.cxx -cui/source/dialogs/about.cxx cui/source/dialogs/cuifmsearch.cxx cui/source/dialogs/cuigaldlg.cxx cui/source/dialogs/cuigrfflt.cxx commit 78461f9db0ad0dd3e16a881d79bcf1d863594436 Author: Michael Weghorn <[email protected]> AuthorDate: Wed Dec 10 23:57:38 2025 +0100 Commit: Michael Weghorn <[email protected]> CommitDate: Fri Dec 12 13:25:45 2025 +0100 tdf#130857 weld: Reuse existing weld::Widget command logic for TreeView Drop the weld::TreeView-specific logic for signalling CommandEvent of type ContextMenu and reuse the existing logic implemented in the weld::Widget base class instead, which was moved there in previous commit Change-Id: I9367bdbb8be7994057667fab539aaf135751e063 Author: Michael Weghorn <[email protected]> Date: Wed Dec 10 23:08:21 2025 +0100 tdf#130857 weld: Move CommandEvent handling to weld::Widget base Make weld::Widget::connect_command virtual to override it in GtkInstanceTreeView, as was previously the case for the now dropped weld::TreeView::connect_popup_menu. The existing handlers previously connected using weld::TreeView::connect_popup_menu already check whether the type of the event is CommandEventId::ContextMenu, so no change in behavior is expected. In a quick test, the sample scenario of the template dialog as described in commit 5d287676541d4f844b9b641a05f392d351f30d72 Author: Michael Weghorn <[email protected]> Date: Tue Dec 9 20:13:07 2025 +0100 tdf#130857 qt weld: Forward TreeView context menu event still worked as expected with gtk3 and gen as well as with an experimental branch for qt6 where support for using native Qt widgets for that dialog is declared. Change-Id: I13baf51eda2c9f0adc9c167ab50e920d23ada07e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195415 Tested-by: Jenkins Reviewed-by: Michael Weghorn <[email protected]> diff --git a/basctl/source/basicide/bastype2.cxx b/basctl/source/basicide/bastype2.cxx index 65c94ebb02d6..40aeadca93dd 100644 --- a/basctl/source/basicide/bastype2.cxx +++ b/basctl/source/basicide/bastype2.cxx @@ -172,7 +172,7 @@ SbTreeListBox::SbTreeListBox(std::unique_ptr<weld::TreeView> xControl, weld::Win { m_xControl->connect_row_activated(LINK(this, SbTreeListBox, OpenCurrentHdl)); m_xControl->connect_expanding(LINK(this, SbTreeListBox, RequestingChildrenHdl)); - m_xControl->connect_popup_menu(LINK(this, SbTreeListBox, ContextMenuHdl)); + m_xControl->connect_command(LINK(this, SbTreeListBox, ContextMenuHdl)); nMode = BrowseMode::All; // everything } diff --git a/basctl/source/basicide/macrodlg.cxx b/basctl/source/basicide/macrodlg.cxx index 9c92dcab4648..d42f0e440c8f 100644 --- a/basctl/source/basicide/macrodlg.cxx +++ b/basctl/source/basicide/macrodlg.cxx @@ -103,7 +103,7 @@ MacroChooser::MacroChooser(weld::Window* pParnt, const Reference< frame::XFrame m_xMacroBox->connect_row_activated( LINK( this, MacroChooser, MacroDoubleClickHdl ) ); m_xMacroBox->connect_selection_changed(LINK(this, MacroChooser, MacroSelectHdl)); - m_xMacroBox->connect_popup_menu( LINK( this, MacroChooser, ContextMenuHdl ) ); + m_xMacroBox->connect_command(LINK(this, MacroChooser, ContextMenuHdl)); m_xBasicBox->SetMode( BrowseMode::Modules ); diff --git a/cui/source/customize/SvxMenuConfigPage.cxx b/cui/source/customize/SvxMenuConfigPage.cxx index 72a3d350125e..61f0f0e82a0f 100644 --- a/cui/source/customize/SvxMenuConfigPage.cxx +++ b/cui/source/customize/SvxMenuConfigPage.cxx @@ -56,9 +56,9 @@ SvxMenuConfigPage::SvxMenuConfigPage(weld::Container* pPage, weld::DialogControl rTreeView.show(); rTreeView.connect_selection_changed(LINK(this, SvxMenuConfigPage, SelectMenuEntry)); - rTreeView.connect_popup_menu(LINK(this, SvxMenuConfigPage, ContentContextMenuHdl)); + rTreeView.connect_command(LINK(this, SvxMenuConfigPage, ContentContextMenuHdl)); - m_xFunctions->get_widget().connect_popup_menu( + m_xFunctions->get_widget().connect_command( LINK(this, SvxMenuConfigPage, FunctionContextMenuHdl)); m_xGearBtn->connect_selected(LINK(this, SvxMenuConfigPage, GearHdl)); diff --git a/cui/source/customize/SvxToolbarConfigPage.cxx b/cui/source/customize/SvxToolbarConfigPage.cxx index e8323d18f9b1..f6bb35054e5d 100644 --- a/cui/source/customize/SvxToolbarConfigPage.cxx +++ b/cui/source/customize/SvxToolbarConfigPage.cxx @@ -69,9 +69,9 @@ SvxToolbarConfigPage::SvxToolbarConfigPage(weld::Container* pPage, rTreeView.show(); rTreeView.connect_selection_changed(LINK(this, SvxToolbarConfigPage, SelectToolbarEntry)); - rTreeView.connect_popup_menu(LINK(this, SvxToolbarConfigPage, ContentContextMenuHdl)); + rTreeView.connect_command(LINK(this, SvxToolbarConfigPage, ContentContextMenuHdl)); - m_xFunctions->get_widget().connect_popup_menu( + m_xFunctions->get_widget().connect_command( LINK(this, SvxToolbarConfigPage, FunctionContextMenuHdl)); m_xTopLevelListBox->set_help_id(HID_SVX_TOPLEVELLISTBOX); diff --git a/cui/source/customize/cfgutil.cxx b/cui/source/customize/cfgutil.cxx index c6562f705a7c..9f6964fbe8fd 100644 --- a/cui/source/customize/cfgutil.cxx +++ b/cui/source/customize/cfgutil.cxx @@ -1173,7 +1173,7 @@ SvxScriptSelectorDialog::SvxScriptSelectorDialog( LINK( this, SvxScriptSelectorDialog, SelectHdl ) ); m_xCommands->connect_changed( LINK( this, SvxScriptSelectorDialog, SelectHdl ) ); m_xCommands->connect_row_activated( LINK( this, SvxScriptSelectorDialog, FunctionDoubleClickHdl ) ); - m_xCommands->connect_popup_menu( LINK( this, SvxScriptSelectorDialog, ContextMenuHdl ) ); + m_xCommands->connect_command( LINK( this, SvxScriptSelectorDialog, ContextMenuHdl ) ); m_xOKButton->connect_clicked( LINK( this, SvxScriptSelectorDialog, ClickHdl ) ); m_xCancelButton->connect_clicked( LINK( this, SvxScriptSelectorDialog, ClickHdl ) ); diff --git a/cui/source/dialogs/MacroManagerDialog.cxx b/cui/source/dialogs/MacroManagerDialog.cxx index 468cd5c821fd..125152770c20 100644 --- a/cui/source/dialogs/MacroManagerDialog.cxx +++ b/cui/source/dialogs/MacroManagerDialog.cxx @@ -664,7 +664,7 @@ MacroManagerDialog::MacroManagerDialog(weld::Window* pParent, m_xScriptsListBox->connect_changed(LINK(this, MacroManagerDialog, SelectHdl)); m_xScriptsListBox->connect_row_activated( LINK(this, MacroManagerDialog, FunctionDoubleClickHdl)); - m_xScriptsListBox->connect_popup_menu(LINK(this, MacroManagerDialog, ContextMenuHdl)); + m_xScriptsListBox->connect_command(LINK(this, MacroManagerDialog, ContextMenuHdl)); m_xAssignButton->connect_clicked(LINK(this, MacroManagerDialog, ClickHdl)); m_xRunButton->connect_clicked(LINK(this, MacroManagerDialog, ClickHdl)); diff --git a/cui/source/inc/MacroManagerDialog.hxx b/cui/source/inc/MacroManagerDialog.hxx index a8c48426ad6b..f7f131c14fec 100644 --- a/cui/source/inc/MacroManagerDialog.hxx +++ b/cui/source/inc/MacroManagerDialog.hxx @@ -73,9 +73,9 @@ public: { m_xTreeView->connect_selection_changed(rLink); } - void connect_popup_menu(const Link<const CommandEvent&, bool>& rLink) + void connect_command(const Link<const CommandEvent&, bool>& rLink) { - m_xTreeView->connect_popup_menu(rLink); + m_xTreeView->connect_command(rLink); } void connect_row_activated(const Link<weld::TreeView&, bool>& rLink) { diff --git a/cui/source/inc/cfgutil.hxx b/cui/source/inc/cfgutil.hxx index 12f3843118ad..224194326e7e 100644 --- a/cui/source/inc/cfgutil.hxx +++ b/cui/source/inc/cfgutil.hxx @@ -118,7 +118,7 @@ public: { m_xTreeView->connect_selection_changed(rLink); } - void connect_popup_menu(const Link<const CommandEvent&, bool>& rLink) { m_xTreeView->connect_popup_menu(rLink); } + void connect_command(const Link<const CommandEvent&, bool>& rLink) { m_xTreeView->connect_command(rLink); } void connect_row_activated(const Link<weld::TreeView&, bool>& rLink) { m_xTreeView->connect_row_activated(rLink); } void freeze() { m_xTreeView->freeze(); } void thaw() { m_xTreeView->thaw(); } diff --git a/dbaccess/source/ui/control/dbtreelistbox.cxx b/dbaccess/source/ui/control/dbtreelistbox.cxx index 92e6f2e7d659..c9c466ed3730 100644 --- a/dbaccess/source/ui/control/dbtreelistbox.cxx +++ b/dbaccess/source/ui/control/dbtreelistbox.cxx @@ -115,7 +115,7 @@ TreeListBox::TreeListBox(std::unique_ptr<weld::TreeView> xTreeView, bool bSQLTyp m_xTreeView->connect_key_press(LINK(this, TreeListBox, KeyInputHdl)); m_xTreeView->connect_selection_changed(LINK(this, TreeListBox, SelectHdl)); m_xTreeView->connect_query_tooltip(LINK(this, TreeListBox, QueryTooltipHdl)); - m_xTreeView->connect_popup_menu(LINK(this, TreeListBox, CommandHdl)); + m_xTreeView->connect_command(LINK(this, TreeListBox, CommandHdl)); if (bSQLType) m_xHelper.set(new ODataClipboard); diff --git a/dbaccess/source/ui/misc/WTypeSelect.cxx b/dbaccess/source/ui/misc/WTypeSelect.cxx index 4224ea66b9f8..622c7da18bbc 100644 --- a/dbaccess/source/ui/misc/WTypeSelect.cxx +++ b/dbaccess/source/ui/misc/WTypeSelect.cxx @@ -325,7 +325,7 @@ OWizTypeSelectList::OWizTypeSelectList(std::unique_ptr<weld::TreeView> xControl) : m_xControl(std::move(xControl)) , m_bPKey(false) { - m_xControl->connect_popup_menu(LINK(this, OWizTypeSelectList, CommandHdl)); + m_xControl->connect_command(LINK(this, OWizTypeSelectList, CommandHdl)); } bool OWizTypeSelectList::IsPrimaryKeyAllowed() const diff --git a/dbaccess/source/ui/querydesign/TableWindowListBox.cxx b/dbaccess/source/ui/querydesign/TableWindowListBox.cxx index 0141b8ed89f4..1d159e129616 100644 --- a/dbaccess/source/ui/querydesign/TableWindowListBox.cxx +++ b/dbaccess/source/ui/querydesign/TableWindowListBox.cxx @@ -51,7 +51,7 @@ OTableWindowListBox::OTableWindowListBox(OTableWindow* pParent) { m_xTreeView->connect_row_activated(LINK(this, OTableWindowListBox, OnDoubleClick)); m_xTreeView->connect_visible_range_changed(LINK(this, OTableWindowListBox, ScrollHdl)); - m_xTreeView->connect_popup_menu(LINK(this, OTableWindowListBox, CommandHdl)); + m_xTreeView->connect_command(LINK(this, OTableWindowListBox, CommandHdl)); m_xHelper.set(new OJoinExchObj); rtl::Reference<TransferDataContainer> xHelper(m_xHelper); diff --git a/fpicker/source/office/fileview.cxx b/fpicker/source/office/fileview.cxx index f7eed3217ce4..ef54a01c0a96 100644 --- a/fpicker/source/office/fileview.cxx +++ b/fpicker/source/office/fileview.cxx @@ -451,7 +451,7 @@ ViewTabListBox_Impl::ViewTabListBox_Impl(std::unique_ptr<weld::TreeView> xTreeVi mxCmdEnv = new ::ucbhelper::CommandEnvironment( xInteractionHandler, Reference< XProgressHandler >() ); - mxTreeView->connect_popup_menu(LINK(this, ViewTabListBox_Impl, CommandHdl)); + mxTreeView->connect_command(LINK(this, ViewTabListBox_Impl, CommandHdl)); mxTreeView->connect_key_press(LINK(this, ViewTabListBox_Impl, KeyInputHdl)); } diff --git a/include/vcl/jsdialog/executor.hxx b/include/vcl/jsdialog/executor.hxx index 949e081b89b2..374c1b1f1a64 100644 --- a/include/vcl/jsdialog/executor.hxx +++ b/include/vcl/jsdialog/executor.hxx @@ -54,7 +54,7 @@ public: static void trigger_popup_menu(weld::TreeView& rTreeView, const CommandEvent& rCommand) { - rTreeView.signal_popup_menu(rCommand); + rTreeView.signal_command(rCommand); } static void trigger_activated(weld::Menu& rMenu, const OUString& rIdent) diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx index 5789ea182236..8bc8f0be4f55 100644 --- a/include/vcl/weld.hxx +++ b/include/vcl/weld.hxx @@ -245,7 +245,10 @@ public: virtual void set_cursor_data(void* pData) = 0; - void connect_command(const Link<const CommandEvent&, bool>& rLink) { m_aCommandHdl = rLink; } + virtual void connect_command(const Link<const CommandEvent&, bool>& rLink) + { + m_aCommandHdl = rLink; + } virtual void connect_focus_in(const Link<Widget&, void>& rLink) { @@ -1039,9 +1042,6 @@ public: private: OUString m_sSavedValue; - // if handler returns true, then menu has been shown and event is consumed - Link<const CommandEvent&, bool> m_aPopupMenuHdl; - protected: Link<TreeView&, void> m_aSelectionChangedHdl; Link<TreeView&, bool> m_aRowActivatedHdl; @@ -1107,8 +1107,6 @@ protected: return m_aEditingDoneHdl.Call(rIterText); } - bool signal_popup_menu(const CommandEvent& rCommand) { return m_aPopupMenuHdl.Call(rCommand); } - Link<const TreeIter&, OUString> m_aQueryTooltipHdl; OUString signal_query_tooltip(const TreeIter& rIter) @@ -1533,11 +1531,6 @@ public: m_aVisibleRangeChangedHdl = rLink; } - virtual void connect_popup_menu(const Link<const CommandEvent&, bool>& rLink) - { - m_aPopupMenuHdl = rLink; - } - virtual void enable_drag_source(rtl::Reference<TransferDataContainer>& rTransferable, sal_uInt8 eDNDConstants) = 0; diff --git a/reportdesign/source/ui/dlg/Navigator.cxx b/reportdesign/source/ui/dlg/Navigator.cxx index 65d89359c372..9ddad883ee9f 100644 --- a/reportdesign/source/ui/dlg/Navigator.cxx +++ b/reportdesign/source/ui/dlg/Navigator.cxx @@ -221,7 +221,7 @@ NavigatorTree::NavigatorTree(std::unique_ptr<weld::TreeView> xTreeView, OReportC m_xTreeView->set_selection_mode(SelectionMode::Multiple); m_xTreeView->connect_selection_changed(LINK(this, NavigatorTree, OnEntrySelDesel)); - m_xTreeView->connect_popup_menu(LINK(this, NavigatorTree, CommandHdl)); + m_xTreeView->connect_command(LINK(this, NavigatorTree, CommandHdl)); } NavigatorTree::~NavigatorTree() diff --git a/sc/source/ui/cctrl/checklistmenu.cxx b/sc/source/ui/cctrl/checklistmenu.cxx index c1d5f64ca37c..a3e763f7d025 100644 --- a/sc/source/ui/cctrl/checklistmenu.cxx +++ b/sc/source/ui/cctrl/checklistmenu.cxx @@ -588,8 +588,8 @@ ScCheckListMenuControl::ScCheckListMenuControl(weld::Widget* pParent, ScViewData mxEdSearch->connect_mouse_move(LINK(this, ScCheckListMenuControl, MouseEnterHdl)); mxListChecks->connect_mouse_move(LINK(this, ScCheckListMenuControl, MouseEnterHdl)); mxTreeChecks->connect_mouse_move(LINK(this, ScCheckListMenuControl, MouseEnterHdl)); - mxListChecks->connect_popup_menu(LINK(this, ScCheckListMenuControl, CommandHdl)); - mxTreeChecks->connect_popup_menu(LINK(this, ScCheckListMenuControl, CommandHdl)); + mxListChecks->connect_command(LINK(this, ScCheckListMenuControl, CommandHdl)); + mxTreeChecks->connect_command(LINK(this, ScCheckListMenuControl, CommandHdl)); mxChkToggleAll->connect_mouse_move(LINK(this, ScCheckListMenuControl, MouseEnterHdl)); mxChkLockChecked->connect_mouse_move(LINK(this, ScCheckListMenuControl, MouseEnterHdl)); mxBtnSelectSingle->connect_mouse_move(LINK(this, ScCheckListMenuControl, MouseEnterHdl)); diff --git a/sc/source/ui/miscdlgs/acredlin.cxx b/sc/source/ui/miscdlgs/acredlin.cxx index a137609d2f94..2dee766a189a 100644 --- a/sc/source/ui/miscdlgs/acredlin.cxx +++ b/sc/source/ui/miscdlgs/acredlin.cxx @@ -127,7 +127,7 @@ ScAcceptChgDlg::ScAcceptChgDlg(SfxBindings* pB, SfxChildWindow* pCW, weld::Windo weld::TreeView& rTreeView = pTheView->GetWidget(); rTreeView.connect_expanding(LINK(this, ScAcceptChgDlg, ExpandingHandle)); rTreeView.connect_selection_changed(LINK(this, ScAcceptChgDlg, SelectHandle)); - rTreeView.connect_popup_menu(LINK(this, ScAcceptChgDlg, CommandHdl)); + rTreeView.connect_command(LINK(this, ScAcceptChgDlg, CommandHdl)); rTreeView.set_sort_func([this](const weld::TreeIter& rLeft, const weld::TreeIter& rRight){ return ColCompareHdl(rLeft, rRight); }); diff --git a/sc/source/ui/navipi/content.cxx b/sc/source/ui/navipi/content.cxx index 8d9433d84115..03ccbd8ee0db 100644 --- a/sc/source/ui/navipi/content.cxx +++ b/sc/source/ui/navipi/content.cxx @@ -138,7 +138,7 @@ ScContentTree::ScContentTree(std::unique_ptr<weld::TreeView> xTreeView, ScNaviga m_xTreeView->connect_row_activated(LINK(this, ScContentTree, ContentDoubleClickHdl)); m_xTreeView->connect_mouse_release(LINK(this, ScContentTree, MouseReleaseHdl)); m_xTreeView->connect_key_press(LINK(this, ScContentTree, KeyInputHdl)); - m_xTreeView->connect_popup_menu(LINK(this, ScContentTree, CommandHdl)); + m_xTreeView->connect_command(LINK(this, ScContentTree, CommandHdl)); m_xTreeView->connect_query_tooltip(LINK(this, ScContentTree, QueryTooltipHdl)); rtl::Reference<TransferDataContainer> xHelper(m_xTransferObj); diff --git a/sc/source/ui/navipi/scenwnd.cxx b/sc/source/ui/navipi/scenwnd.cxx index eb62a7d5b6bc..492286d30dc1 100644 --- a/sc/source/ui/navipi/scenwnd.cxx +++ b/sc/source/ui/navipi/scenwnd.cxx @@ -198,7 +198,7 @@ ScScenarioWindow::ScScenarioWindow(weld::Builder& rBuilder, const OUString& aQH_ m_xLbScenario->connect_selection_changed(LINK(this, ScScenarioWindow, SelectHdl)); m_xLbScenario->connect_row_activated(LINK(this, ScScenarioWindow, DoubleClickHdl)); m_xLbScenario->connect_key_press(LINK(this, ScScenarioWindow, KeyInputHdl)); - m_xLbScenario->connect_popup_menu(LINK(this, ScScenarioWindow, ContextMenuHdl)); + m_xLbScenario->connect_command(LINK(this, ScScenarioWindow, ContextMenuHdl)); SfxViewFrame* pViewFrm = SfxViewFrame::Current(); if (pViewFrm) diff --git a/sd/source/ui/animations/CustomAnimationList.cxx b/sd/source/ui/animations/CustomAnimationList.cxx index c10f1421bfba..c63699d2f345 100644 --- a/sd/source/ui/animations/CustomAnimationList.cxx +++ b/sd/source/ui/animations/CustomAnimationList.cxx @@ -453,7 +453,7 @@ CustomAnimationList::CustomAnimationList(std::unique_ptr<weld::TreeView> xTreeVi mxTreeView->set_selection_mode(SelectionMode::Multiple); mxTreeView->connect_selection_changed(LINK(this, CustomAnimationList, SelectHdl)); mxTreeView->connect_key_press(LINK(this, CustomAnimationList, KeyInputHdl)); - mxTreeView->connect_popup_menu(LINK(this, CustomAnimationList, CommandHdl)); + mxTreeView->connect_command(LINK(this, CustomAnimationList, CommandHdl)); mxTreeView->connect_row_activated(LINK(this, CustomAnimationList, DoubleClickHdl)); mxTreeView->connect_expanding(LINK(this, CustomAnimationList, ExpandHdl)); mxTreeView->connect_collapsing(LINK(this, CustomAnimationList, CollapseHdl)); diff --git a/sd/source/ui/dlg/sdtreelb.cxx b/sd/source/ui/dlg/sdtreelb.cxx index 05544e0cd26c..85b7aeea204f 100644 --- a/sd/source/ui/dlg/sdtreelb.cxx +++ b/sd/source/ui/dlg/sdtreelb.cxx @@ -782,7 +782,7 @@ SdPageObjsTLV::SdPageObjsTLV(std::unique_ptr<weld::TreeView> xTreeView) m_xTreeView->connect_mouse_release(LINK(this, SdPageObjsTLV, MouseReleaseHdl)); m_xTreeView->connect_editing(LINK(this, SdPageObjsTLV, EditingEntryHdl), LINK(this, SdPageObjsTLV, EditedEntryHdl)); - m_xTreeView->connect_popup_menu(LINK(this, SdPageObjsTLV, CommandHdl)); + m_xTreeView->connect_command(LINK(this, SdPageObjsTLV, CommandHdl)); m_xTreeView->set_size_request(m_xTreeView->get_approximate_digit_width() * 28, m_xTreeView->get_text_height() * 8); diff --git a/sfx2/source/appl/newhelp.cxx b/sfx2/source/appl/newhelp.cxx index d50d6ae88308..35aeff4b4196 100644 --- a/sfx2/source/appl/newhelp.cxx +++ b/sfx2/source/appl/newhelp.cxx @@ -1153,7 +1153,7 @@ BookmarksTabPage_Impl::BookmarksTabPage_Impl(weld::Widget* pParent, SfxHelpIndex m_xBookmarksPB->connect_clicked( LINK(this, BookmarksTabPage_Impl, OpenHdl)); m_xBookmarksBox->connect_row_activated(LINK(this, BookmarksTabPage_Impl, DoubleClickHdl)); - m_xBookmarksBox->connect_popup_menu(LINK(this, BookmarksTabPage_Impl, CommandHdl)); + m_xBookmarksBox->connect_command(LINK(this, BookmarksTabPage_Impl, CommandHdl)); m_xBookmarksBox->connect_key_press(LINK(this, BookmarksTabPage_Impl, KeyInputHdl)); // load bookmarks from configuration diff --git a/sfx2/source/control/templatedlglocalview.cxx b/sfx2/source/control/templatedlglocalview.cxx index 771493e38cfe..128b59b1d932 100644 --- a/sfx2/source/control/templatedlglocalview.cxx +++ b/sfx2/source/control/templatedlglocalview.cxx @@ -32,7 +32,7 @@ TemplateDlgLocalView::TemplateDlgLocalView(std::unique_ptr<weld::ScrolledWindow> mxTreeView->connect_row_activated(LINK(this, TemplateDlgLocalView, RowActivatedHdl)); mxTreeView->connect_column_clicked(LINK(this, ListView, ColumnClickedHdl)); mxTreeView->connect_selection_changed(LINK(this, TemplateDlgLocalView, ListViewChangedHdl)); - mxTreeView->connect_popup_menu(LINK(this, TemplateDlgLocalView, PopupMenuHdl)); + mxTreeView->connect_command(LINK(this, TemplateDlgLocalView, PopupMenuHdl)); mxTreeView->connect_key_press(LINK(this, TemplateDlgLocalView, KeyPressHdl)); } diff --git a/sfx2/source/devtools/ObjectInspectorTreeHandler.cxx b/sfx2/source/devtools/ObjectInspectorTreeHandler.cxx index 22c879ecd466..59fa2df28d33 100644 --- a/sfx2/source/devtools/ObjectInspectorTreeHandler.cxx +++ b/sfx2/source/devtools/ObjectInspectorTreeHandler.cxx @@ -938,7 +938,7 @@ ObjectInspectorTreeHandler::ObjectInspectorTreeHandler( mpObjectInspectorWidgets->mpMethodsTreeView->connect_expanding( LINK(this, ObjectInspectorTreeHandler, ExpandingHandlerMethods)); - mpObjectInspectorWidgets->mpPropertiesTreeView->connect_popup_menu( + mpObjectInspectorWidgets->mpPropertiesTreeView->connect_command( LINK(this, ObjectInspectorTreeHandler, PopupMenuHandler)); mpObjectInspectorWidgets->mpInterfacesTreeView->connect_selection_changed( diff --git a/sfx2/source/dialog/StyleList.cxx b/sfx2/source/dialog/StyleList.cxx index 9d7064b0c94b..aa54cee7ff57 100644 --- a/sfx2/source/dialog/StyleList.cxx +++ b/sfx2/source/dialog/StyleList.cxx @@ -369,14 +369,14 @@ void StyleList::Initialize() m_xFmtLb->connect_mouse_press(LINK(this, StyleList, MousePressHdl)); m_xFmtLb->connect_query_tooltip(LINK(this, StyleList, QueryTooltipHdl)); m_xFmtLb->connect_selection_changed(LINK(this, StyleList, FmtSelectHdl)); - m_xFmtLb->connect_popup_menu(LINK(this, StyleList, PopupFlatMenuHdl)); + m_xFmtLb->connect_command(LINK(this, StyleList, PopupFlatMenuHdl)); m_xFmtLb->connect_key_press(LINK(this, StyleList, KeyInputHdl)); m_xFmtLb->set_selection_mode(SelectionMode::Multiple); m_xTreeBox->connect_selection_changed(LINK(this, StyleList, FmtSelectHdl)); m_xTreeBox->connect_row_activated(LINK(this, StyleList, TreeListApplyHdl)); m_xTreeBox->connect_mouse_press(LINK(this, StyleList, MousePressHdl)); m_xTreeBox->connect_query_tooltip(LINK(this, StyleList, QueryTooltipHdl)); - m_xTreeBox->connect_popup_menu(LINK(this, StyleList, PopupTreeMenuHdl)); + m_xTreeBox->connect_command(LINK(this, StyleList, PopupTreeMenuHdl)); m_xTreeBox->connect_key_press(LINK(this, StyleList, KeyInputHdl)); m_xTreeBox->connect_drag_begin(LINK(this, StyleList, DragBeginHdl)); m_xTreeView1DropTargetHelper.reset(new TreeViewDropTarget(*this, *m_xFmtLb)); diff --git a/svx/source/form/datanavi.cxx b/svx/source/form/datanavi.cxx index c6053e6b1aa6..9197cab82420 100644 --- a/svx/source/form/datanavi.cxx +++ b/svx/source/form/datanavi.cxx @@ -237,7 +237,7 @@ namespace svxform m_xItemList->connect_selection_changed(LINK(this, XFormsPage, ItemSelectHdl)); m_xItemList->connect_key_press(LINK(this, XFormsPage, KeyInputHdl)); - m_xItemList->connect_popup_menu(LINK(this, XFormsPage, PopupMenuHdl)); + m_xItemList->connect_command(LINK(this, XFormsPage, PopupMenuHdl)); ItemSelectHdl(*m_xItemList); } diff --git a/svx/source/form/filtnav.cxx b/svx/source/form/filtnav.cxx index 4b5665ca6f61..2a8b307258ca 100644 --- a/svx/source/form/filtnav.cxx +++ b/svx/source/form/filtnav.cxx @@ -1062,7 +1062,7 @@ FmFilterNavigator::FmFilterNavigator(vcl::Window* pTopLevel, std::unique_ptr<wel m_xTreeView->connect_selection_changed(LINK(this, FmFilterNavigator, SelectHdl)); m_xTreeView->connect_key_press(LINK(this, FmFilterNavigator, KeyInputHdl)); - m_xTreeView->connect_popup_menu(LINK(this, FmFilterNavigator, PopupMenuHdl)); + m_xTreeView->connect_command(LINK(this, FmFilterNavigator, PopupMenuHdl)); m_xTreeView->connect_editing(LINK(this, FmFilterNavigator, EditingEntryHdl), LINK(this, FmFilterNavigator, EditedEntryHdl)); m_xTreeView->connect_drag_begin(LINK(this, FmFilterNavigator, DragBeginHdl)); diff --git a/svx/source/form/navigatortree.cxx b/svx/source/form/navigatortree.cxx index 17571e16838c..1a573ef0e633 100644 --- a/svx/source/form/navigatortree.cxx +++ b/svx/source/form/navigatortree.cxx @@ -158,7 +158,7 @@ namespace svxform m_aSynchronizeTimer.SetInvokeHandler(LINK(this, NavigatorTree, OnSynchronizeTimer)); m_xTreeView->connect_selection_changed(LINK(this, NavigatorTree, OnEntrySelDesel)); m_xTreeView->connect_key_press(LINK(this, NavigatorTree, KeyInputHdl)); - m_xTreeView->connect_popup_menu(LINK(this, NavigatorTree, PopupMenuHdl)); + m_xTreeView->connect_command(LINK(this, NavigatorTree, PopupMenuHdl)); m_xTreeView->connect_editing(LINK(this, NavigatorTree, EditingEntryHdl), LINK(this, NavigatorTree, EditedEntryHdl)); m_xTreeView->connect_drag_begin(LINK(this, NavigatorTree, DragBeginHdl)); diff --git a/svx/source/gallery2/galbrws1.cxx b/svx/source/gallery2/galbrws1.cxx index 4d04bcacf6a0..0e49b2d64415 100644 --- a/svx/source/gallery2/galbrws1.cxx +++ b/svx/source/gallery2/galbrws1.cxx @@ -151,7 +151,7 @@ GalleryBrowser::GalleryBrowser( mxThemes->make_sorted(); mxThemes->connect_selection_changed(LINK(this, GalleryBrowser, SelectThemeHdl)); - mxThemes->connect_popup_menu(LINK(this, GalleryBrowser, PopupMenuHdl1)); + mxThemes->connect_command(LINK(this, GalleryBrowser, PopupMenuHdl1)); mxThemes->connect_key_press(LINK(this, GalleryBrowser, KeyInputHdl1)); mxThemes->set_size_request(-1, mxThemes->get_height_rows(6)); @@ -184,7 +184,7 @@ GalleryBrowser::GalleryBrowser( mxListView->connect_visible_range_changed(LINK(this, GalleryBrowser, VisRowsScrolledHdl)); mxListView->connect_size_allocate(LINK(this, GalleryBrowser, SizeAllocHdl)); mxListView->connect_selection_changed(LINK(this, GalleryBrowser, SelectObjectHdl)); - mxListView->connect_popup_menu(LINK(this, GalleryBrowser, PopupMenuHdl2)); + mxListView->connect_command(LINK(this, GalleryBrowser, PopupMenuHdl2)); mxListView->connect_key_press(LINK(this, GalleryBrowser, KeyInputHdl2)); mxListView->connect_row_activated(LINK(this, GalleryBrowser, RowActivatedHdl)); mxDragDropTargetHelper.reset(new GalleryDragDrop(this, mxListView->get_drop_target())); diff --git a/sw/source/uibase/misc/redlndlg.cxx b/sw/source/uibase/misc/redlndlg.cxx index afdad416adec..8595cfe292e7 100644 --- a/sw/source/uibase/misc/redlndlg.cxx +++ b/sw/source/uibase/misc/redlndlg.cxx @@ -240,7 +240,7 @@ SwRedlineAcceptDlg::SwRedlineAcceptDlg(std::shared_ptr<weld::Window> xParent, we rTreeView.set_selection_mode(SelectionMode::Multiple); rTreeView.connect_selection_changed(LINK(this, SwRedlineAcceptDlg, SelectHdl)); - rTreeView.connect_popup_menu(LINK(this, SwRedlineAcceptDlg, CommandHdl)); + rTreeView.connect_command(LINK(this, SwRedlineAcceptDlg, CommandHdl)); // avoid multiple selection of the same texts: m_aSelectTimer.SetTimeout(100); diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index 36d6a3711595..64e09fec7879 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -1193,7 +1193,7 @@ SwContentTree::SwContentTree(std::unique_ptr<weld::TreeView> xTreeView, SwNaviga m_xTreeView->connect_selection_changed(LINK(this, SwContentTree, SelectHdl)); m_xTreeView->connect_focus_in(LINK(this, SwContentTree, FocusInHdl)); m_xTreeView->connect_key_press(LINK(this, SwContentTree, KeyInputHdl)); - m_xTreeView->connect_popup_menu(LINK(this, SwContentTree, CommandHdl)); + m_xTreeView->connect_command(LINK(this, SwContentTree, CommandHdl)); m_xTreeView->connect_query_tooltip(LINK(this, SwContentTree, QueryTooltipHdl)); m_xTreeView->connect_drag_begin(LINK(this, SwContentTree, DragBeginHdl)); m_xTreeView->connect_mouse_move(LINK(this, SwContentTree, MouseMoveHdl)); diff --git a/sw/source/uibase/utlui/glbltree.cxx b/sw/source/uibase/utlui/glbltree.cxx index ab9aa234ccfc..6fbef0da2ea8 100644 --- a/sw/source/uibase/utlui/glbltree.cxx +++ b/sw/source/uibase/utlui/glbltree.cxx @@ -149,7 +149,7 @@ SwGlobalTree::SwGlobalTree(std::unique_ptr<weld::TreeView> xTreeView, SwNavigati m_xTreeView->connect_selection_changed(LINK(this, SwGlobalTree, SelectHdl)); m_xTreeView->connect_focus_in(LINK(this, SwGlobalTree, FocusInHdl)); m_xTreeView->connect_key_press(LINK(this, SwGlobalTree, KeyInputHdl)); - m_xTreeView->connect_popup_menu(LINK(this, SwGlobalTree, CommandHdl)); + m_xTreeView->connect_command(LINK(this, SwGlobalTree, CommandHdl)); m_xTreeView->connect_query_tooltip(LINK(this, SwGlobalTree, QueryTooltipHdl)); } diff --git a/vcl/qt5/QtInstanceTreeView.cxx b/vcl/qt5/QtInstanceTreeView.cxx index 0a1fe12d3eac..abaf70a6f92a 100644 --- a/vcl/qt5/QtInstanceTreeView.cxx +++ b/vcl/qt5/QtInstanceTreeView.cxx @@ -1116,7 +1116,7 @@ bool QtInstanceTreeView::eventFilter(QObject* pObject, QEvent* pEvent) QContextMenuEvent* pContextMenuEvent = static_cast<QContextMenuEvent*>(pEvent); CommandEvent aCEvt(toPoint(pContextMenuEvent->pos()), CommandEventId::ContextMenu, pContextMenuEvent->reason() == QContextMenuEvent::Mouse); - return signal_popup_menu(aCEvt); + return signal_command(aCEvt); } return QtInstanceWidget::eventFilter(pObject, pEvent); diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index 451fca68738f..936ececfda44 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -5236,7 +5236,7 @@ bool SalInstanceTreeView::ExpandRow(const SalInstanceTreeIter& rIter) IMPL_LINK(SalInstanceTreeView, PopupMenuHdl, const CommandEvent&, rEvent, bool) { - return signal_popup_menu(rEvent); + return signal_command(rEvent); } IMPL_LINK(SalInstanceTreeView, EditingEntryHdl, SvTreeListEntry*, pEntry, bool) diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx index ba1e5d2eabdf..60c8b7a0f4a9 100644 --- a/vcl/unx/gtk3/gtkinst.cxx +++ b/vcl/unx/gtk3/gtkinst.cxx @@ -13981,7 +13981,7 @@ private: virtual bool signal_popup_menu(const CommandEvent& rCEvt) override { - return weld::TreeView::signal_popup_menu(rCEvt); + return weld::TreeView::signal_command(rCEvt); } void insert_row(GtkTreeIter& iter, const GtkTreeIter* parent, int pos, const OUString* pId, const OUString* pText, @@ -16256,10 +16256,10 @@ public: g_signal_handler_unblock(gtk_tree_view_get_selection(m_pTreeView), m_nChangedSignalId); } - virtual void connect_popup_menu(const Link<const CommandEvent&, bool>& rLink) override + virtual void connect_command(const Link<const CommandEvent&, bool>& rLink) override { ensureButtonPressSignal(); - weld::TreeView::connect_popup_menu(rLink); + weld::TreeView::connect_command(rLink); } virtual bool get_dest_row_at_pos(const Point &rPos, weld::TreeIter* pResult, bool bDnDMode, bool bAutoScroll) override
