cui/source/customize/cfg.cxx | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-)
New commits: commit f68e3a8a2eb807ab2727ca724d5a4fa1e37fa567 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Fri Dec 9 20:56:06 2022 +0000 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Sat Dec 10 10:05:31 2022 +0000 switch to the 'keyboard' tab if a SID_MACROINFO is set Change-Id: Ie615ab2598309b0324daa11732e5345d1a927437 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143896 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caol...@redhat.com> 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 <vcl/decoview.hxx> #include <vcl/virdev.hxx> +#include <sfx2/minfitem.hxx> #include <sfx2/sfxhelp.hxx> #include <sfx2/viewfrm.hxx> #include <sfx2/filedlghelper.hxx> @@ -91,6 +92,7 @@ #include <comphelper/propertysequence.hxx> #include <comphelper/propertyvalue.hxx> #include <comphelper/processfactory.hxx> +#include <config_features.h> 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<const SfxStringItem*>(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)