diff options
author | Caolán McNamara <caolanm@redhat.com> | 2022-12-09 20:56:06 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2022-12-10 10:05:31 +0000 |
commit | f68e3a8a2eb807ab2727ca724d5a4fa1e37fa567 (patch) | |
tree | 974a48d812ff6bb132b15e2927f623f950413dd4 /cui/source | |
parent | c5844bad90dd056ca533ba86443e179ee4611f2c (diff) |
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 <caolanm@redhat.com>
Diffstat (limited to 'cui/source')
-rw-r--r-- | cui/source/customize/cfg.cxx | 16 |
1 files changed, 10 insertions, 6 deletions
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) |