cui/source/customize/acccfg.cxx |   20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)

New commits:
commit ea6d3f24e2fd8e5017aad7deffc85012a4c5222b
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Mon Nov 16 14:47:49 2020 +0000
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Tue Nov 17 17:09:44 2020 +0100

    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 <xiscofa...@libreoffice.org>

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());
+                    }
                 }
             }
         }
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to