diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2023-09-15 14:48:52 +0200 |
---|---|---|
committer | Julien Nabet <serval2412@yahoo.fr> | 2023-09-15 16:40:47 +0200 |
commit | 5b49cf64482ca8246dbcf5b5f12a11d7f9ed081b (patch) | |
tree | a6f8b8e4cf26e8e05d4becffd6ecb55411d6e8e9 /dbaccess/source/ui | |
parent | 2d43c34333076fad092f0cdc0f60f81580acdbee (diff) |
Fix assertion 'GTK_IS_CHECK_MENU_ITEM (check_menu_item)' in dbaccess
Retrieve odb file https://bugs.documentfoundation.org/attachment.cgi?id=102977
Open the file and edit the only table
Right click at left on a field (except first one)
(soffice:271527): Gtk-CRITICAL **: 14:35:42.787: gtk_check_menu_item_set_active: assertion 'GTK_IS_CHECK_MENU_ITEM (check_menu_item)' failed
(soffice:271527): GLib-GObject-CRITICAL **: 14:35:42.787: invalid (NULL) pointer instance
(soffice:271527): GLib-GObject-CRITICAL **: 14:35:42.787: g_signal_handlers_unblock_matched: assertion 'G_TYPE_CHECK_INSTANCE (instance)' failed
If primary key entry is removed, don't try to call xContextMenu->set_active on it
Change-Id: Ice57d840d12e986eb60514326806782e40f249fb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156946
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'dbaccess/source/ui')
-rw-r--r-- | dbaccess/source/ui/tabledesign/TEditControl.cxx | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/dbaccess/source/ui/tabledesign/TEditControl.cxx b/dbaccess/source/ui/tabledesign/TEditControl.cxx index 241efe597ef4..b3f5dbbe33c8 100644 --- a/dbaccess/source/ui/tabledesign/TEditControl.cxx +++ b/dbaccess/source/ui/tabledesign/TEditControl.cxx @@ -1412,11 +1412,16 @@ void OTableEditorCtrl::Command(const CommandEvent& rEvt) xContextMenu->remove("paste"); if (!IsDeleteAllowed()) xContextMenu->remove("delete"); - if (!IsPrimaryKeyAllowed()) - xContextMenu->remove("primarykey"); if (!IsInsertNewAllowed(nRow)) xContextMenu->remove("insert"); - xContextMenu->set_active("primarykey", IsRowSelected(GetCurRow()) && IsPrimaryKey()); + if (IsPrimaryKeyAllowed()) + { + xContextMenu->set_active("primarykey", IsRowSelected(GetCurRow()) && IsPrimaryKey()); + } + else + { + xContextMenu->remove("primarykey"); + } if( SetDataPtr(m_nDataPos) ) pDescrWin->SaveData( pActRow->GetActFieldDescr() ); |