summaryrefslogtreecommitdiff
path: root/cui/source
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2022-05-04 11:52:58 +0100
committerCaolán McNamara <caolanm@redhat.com>2022-05-04 21:06:22 +0200
commit36aa242429ca992b20574f4974d471d544247362 (patch)
tree5b4faecbf6a442234e8a3da4af309ef3af4b3338 /cui/source
parent7ba88f7981305a08a162b5f38a49dc2bd1143a09 (diff)
Resolves: rhbz#2081661 gtk-critical gtk_tree_view_scroll_to_cell assertion
Change-Id: I4c7c4caed907072ef3a73ccfafabe882d618fa0e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133822 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'cui/source')
-rw-r--r--cui/source/customize/SvxMenuConfigPage.cxx2
-rw-r--r--cui/source/customize/SvxToolbarConfigPage.cxx6
2 files changed, 5 insertions, 3 deletions
diff --git a/cui/source/customize/SvxMenuConfigPage.cxx b/cui/source/customize/SvxMenuConfigPage.cxx
index db0d95904a77..5793825b5d76 100644
--- a/cui/source/customize/SvxMenuConfigPage.cxx
+++ b/cui/source/customize/SvxMenuConfigPage.cxx
@@ -135,7 +135,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 bcf7da3c8c72..bc8346922790 100644
--- a/cui/source/customize/SvxToolbarConfigPage.cxx
+++ b/cui/source/customize/SvxToolbarConfigPage.cxx
@@ -243,10 +243,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 = weld::fromId<SvxConfigEntry*>(m_xTopLevelListBox->get_id(i));