diff options
author | Caolán McNamara <caolanm@redhat.com> | 2022-05-04 11:52:58 +0100 |
---|---|---|
committer | Adolfo Jayme Barrientos <fitojb@ubuntu.com> | 2022-05-06 12:56:13 +0200 |
commit | 816435e4c2d52615462670464c48689bebdf1e55 (patch) | |
tree | 3a270575acd3fd141fcec959672235c8ae2509ca | |
parent | 614049f7bc962f48676a19b5e6e2ded2862280d6 (diff) |
Resolves: rhbz#2081661 gtk-critical gtk_tree_view_scroll_to_cell assertion
Change-Id: I4c7c4caed907072ef3a73ccfafabe882d618fa0e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133730
Tested-by: Jenkins
Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
-rw-r--r-- | cui/source/customize/SvxMenuConfigPage.cxx | 2 | ||||
-rw-r--r-- | cui/source/customize/SvxToolbarConfigPage.cxx | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/cui/source/customize/SvxMenuConfigPage.cxx b/cui/source/customize/SvxMenuConfigPage.cxx index 34cee1368d7a..bf7457193f5c 100644 --- a/cui/source/customize/SvxMenuConfigPage.cxx +++ b/cui/source/customize/SvxMenuConfigPage.cxx @@ -136,7 +136,7 @@ void SvxMenuConfigPage::Init() ReloadTopLevelListBox(); - m_xTopLevelListBox->set_active(0); + m_xTopLevelListBox->set_active(m_xTopLevelListBox->get_count() ? 0 : -1); SelectElement(); m_xCommandCategoryListBox->Init(comphelper::getProcessComponentContext(), m_xFrame, diff --git a/cui/source/customize/SvxToolbarConfigPage.cxx b/cui/source/customize/SvxToolbarConfigPage.cxx index 99a85d82f96e..d2284428d8f1 100644 --- a/cui/source/customize/SvxToolbarConfigPage.cxx +++ b/cui/source/customize/SvxToolbarConfigPage.cxx @@ -246,10 +246,12 @@ void SvxToolbarConfigPage::Init() ReloadTopLevelListBox(); - sal_Int32 nPos = 0; + sal_Int32 nCount = m_xTopLevelListBox->get_count(); + sal_Int32 nPos = nCount > 0 ? 0 : -1; + if (!m_aURLToSelect.isEmpty()) { - for (sal_Int32 i = 0, nCount = m_xTopLevelListBox->get_count(); i < nCount; ++i) + for (sal_Int32 i = 0; i < nCount; ++i) { SvxConfigEntry* pData = reinterpret_cast<SvxConfigEntry*>(m_xTopLevelListBox->get_id(i).toInt64()); |