diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-11-17 10:48:59 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2021-11-17 13:42:52 +0100 |
commit | 753f5d65b4a91e179c61eeea2645ae190eb80155 (patch) | |
tree | 63af6c2288498f30e6855fc69b50a11484349a92 /sc | |
parent | 3171d185f8c17799f0b85f5931aa59101cbc6b4e (diff) |
don't attempt to set cursor to first entry if there are no entries
avoids gtk warning of:
gtk_tree_view_scroll_to_cell: assertion 'tree_view->priv->tree != NULL
Change-Id: Ie2c22a02d795591600a7f6da2e11741ba084a81f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125380
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/cctrl/checklistmenu.cxx | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sc/source/ui/cctrl/checklistmenu.cxx b/sc/source/ui/cctrl/checklistmenu.cxx index 5fcfa27c0c1b..56fb60477220 100644 --- a/sc/source/ui/cctrl/checklistmenu.cxx +++ b/sc/source/ui/cctrl/checklistmenu.cxx @@ -623,8 +623,11 @@ void ScCheckListMenuControl::prepWindow() { mxMenu->set_size_request(-1, mxMenu->get_preferred_size().Height() + 2); mnSelectedMenu = 0; - mxMenu->set_cursor(mnSelectedMenu); - mxMenu->unselect_all(); + if (mxMenu->n_children()) + { + mxMenu->set_cursor(mnSelectedMenu); + mxMenu->unselect_all(); + } mnWndWidth = mxContainer->get_preferred_size().Width() + mxFrame->get_border_width() * 2 + 4; } |