cui/source/customize/acccfg.cxx | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-)
New commits: commit b92d1d509a1db2179779a4776590734590290a41 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Mon Nov 16 14:47:49 2020 +0000 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Mon Nov 16 21:18:09 2020 +0100 tdf#137403 ignore GetCurCommand if its empty Change-Id: I63cc33c33d36d53d882aae72b8f480ea9842e1b5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105945 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caol...@redhat.com> diff --git a/cui/source/customize/acccfg.cxx b/cui/source/customize/acccfg.cxx index 5fc6a95dd4fe..014c8b09f328 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()); + } } } } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits