summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-11-16 14:47:49 +0000
committerXisco Fauli <xiscofauli@libreoffice.org>2020-11-17 17:09:44 +0100
commitea6d3f24e2fd8e5017aad7deffc85012a4c5222b (patch)
tree49939e38a9be4dffb57f440c6ab2db930b4de97f /cui
parent0c624a5c4af585633611b46fd800d1d87b2984bc (diff)
tdf#137403 ignore GetCurCommand if its empty
Change-Id: I63cc33c33d36d53d882aae72b8f480ea9842e1b5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105863 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'cui')
-rw-r--r--cui/source/customize/acccfg.cxx20
1 files changed, 12 insertions, 8 deletions
diff --git a/cui/source/customize/acccfg.cxx b/cui/source/customize/acccfg.cxx
index 7e0a4820fc2e..2ae4f950120e 100644
--- a/cui/source/customize/acccfg.cxx
+++ b/cui/source/customize/acccfg.cxx
@@ -1206,7 +1206,7 @@ IMPL_LINK(SfxAcceleratorConfigPage, SelectHdl, weld::TreeView&, rListBox, void)
m_xRemoveButton->set_sensitive(false);
m_xChangeButton->set_sensitive(false);
- // #i36994 First selected can return zero!
+ // #i36994 First selected can return null!
TAccInfo* pEntry = reinterpret_cast<TAccInfo*>(m_xEntriesBox->get_selected_id().toInt64());
if (pEntry)
{
@@ -1216,19 +1216,23 @@ IMPL_LINK(SfxAcceleratorConfigPage, SelectHdl, weld::TreeView&, rListBox, void)
{
if (pEntry->isConfigured())
m_xRemoveButton->set_sensitive(true);
- m_xChangeButton->set_sensitive(pEntry->m_sCommand != sPossibleNewCommand);
+ m_xChangeButton->set_sensitive(pEntry->m_sCommand != sPossibleNewCommand
+ && !sPossibleNewCommand.isEmpty());
}
// update key box
m_xKeyBox->clear();
- for (int i = 0, nCount = m_xEntriesBox->n_children(); i < nCount; ++i)
+ if (!sPossibleNewCommand.isEmpty())
{
- TAccInfo* pUserData
- = reinterpret_cast<TAccInfo*>(m_xEntriesBox->get_id(i).toInt64());
- if (pUserData && pUserData->m_sCommand == sPossibleNewCommand)
+ for (int i = 0, nCount = m_xEntriesBox->n_children(); i < nCount; ++i)
{
- m_xKeyBox->append(OUString::number(reinterpret_cast<sal_Int64>(pUserData)),
- pUserData->m_aKey.GetName());
+ TAccInfo* pUserData
+ = reinterpret_cast<TAccInfo*>(m_xEntriesBox->get_id(i).toInt64());
+ if (pUserData && pUserData->m_sCommand == sPossibleNewCommand)
+ {
+ m_xKeyBox->append(OUString::number(reinterpret_cast<sal_Int64>(pUserData)),
+ pUserData->m_aKey.GetName());
+ }
}
}
}