From f68e3a8a2eb807ab2727ca724d5a4fa1e37fa567 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Fri, 9 Dec 2022 20:56:06 +0000 Subject: switch to the 'keyboard' tab if a SID_MACROINFO is set MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ie615ab2598309b0324daa11732e5345d1a927437 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143896 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- cui/source/customize/cfg.cxx | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'cui/source') diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx index fe59621c1c4b..0531a9ffa725 100644 --- a/cui/source/customize/cfg.cxx +++ b/cui/source/customize/cfg.cxx @@ -36,6 +36,7 @@ #include #include +#include #include #include #include @@ -91,6 +92,7 @@ #include #include #include +#include namespace uno = com::sun::star::uno; namespace frame = com::sun::star::frame; @@ -215,17 +217,19 @@ SvxConfigDialog::SvxConfigDialog(weld::Window * pParent, const SfxItemSet* pInSe AddTabPage("keyboard", CreateKeyboardConfigPage, nullptr); AddTabPage("events", CreateSvxEventConfigPage, nullptr); - const SfxPoolItem* pItem = pInSet->GetItem( SID_CONFIG ); - - if ( pItem ) + if (const SfxPoolItem* pItem = pInSet->GetItem(SID_CONFIG)) { OUString text = static_cast(pItem)->GetValue(); - if (text.startsWith( ITEM_TOOLBAR_URL ) ) - { SetCurPageId("toolbars"); - } } +#if HAVE_FEATURE_SCRIPTING + // for the "assign" button in the Basic Macros chooser automatically switch + // to the keyboard tab in which this macro will be pre-selected for assigning + // to a keystroke + if (pInSet->GetItemIfSet(SID_MACROINFO)) + SetCurPageId("keyboard"); +#endif } void SvxConfigDialog::ActivatePage(const OString& rPage) -- cgit