ConvertMenu in vcl/unx/gtk4/convert3to4.cxx
assumes that each GtkMenuItem has an "id"
attribute set. Therefore, set one here as well,
to fix a crash seen for the following scenario
in Writer with the gtk4 VCL plugin:
* "Macros" -> "Organize Macros" -> "Basic"
* right-click on entry in the "Existing Macros In: <module>" treeview
Backtrace:
1 __pthread_kill_implementation pthread_kill.c 44 0x7ffff789e95c
2 __pthread_kill_internal pthread_kill.c 89 0x7ffff789e9ff
3 __GI_raise raise.c 26 0x7ffff7849cc2
4 __GI_abort abort.c 73 0x7ffff78324ac
5 __assert_fail_base assert.c 118 0x7ffff7832420
6 com::sun::star::uno::Reference<com::sun::star::xml::dom::XNode>::operator-> Reference.h 387 0x7fffe6263f7b
7 (anonymous namespace)::ConvertMenu convert3to4.cxx 239 0x7fffe625fda7
8 (anonymous namespace)::ConvertMenu convert3to4.cxx 221 0x7fffe625fb3a
9 (anonymous namespace)::Convert3To4 convert3to4.cxx 978 0x7fffe6256a15
10 (anonymous namespace)::Convert3To4 convert3to4.cxx 1010 0x7fffe625726f
11 builder_add_from_gtk3_file convert3to4.cxx 1578 0x7fffe624e6c2
12 (anonymous namespace)::load_ui_file gtkinst.cxx 23922 0x7fffe62a886d
13 (anonymous namespace)::GtkInstanceBuilder::GtkInstanceBuilder gtkinst.cxx 24338 0x7fffe62a852d
14 std::make_unique<(anonymous namespace)::GtkInstanceBuilder, _GtkWidget *&, rtl::OUString const&, rtl::OUString const&, decltype(nullptr), bool>(_GtkWidget *&, rtl::OUString const&, rtl::OUString const&, decltype(nullptr)&&, bool&&) unique_ptr.h 1077 0x7fffe629221a
15 GtkInstance::CreateBuilder gtkinst.cxx 25007 0x7fffe629211f
16 Application::CreateBuilder builder.cxx 206 0x7fffee20c881
17 basctl::MacroChooser::ContextMenuHdl macrodlg.cxx 788 0x7fff0d0a30b0
18 basctl::MacroChooser::LinkStubContextMenuHdl macrodlg.cxx 783 0x7fff0d09cbbd
19 Link<CommandEvent const&, bool>::Call link.hxx 105 0x7fffe6399886
20 (anonymous namespace)::GtkInstanceTreeView::signal_popup_menu gtkinst.cxx 14297 0x7fffe62e367b
21 (anonymous namespace)::GtkInstanceWidget::signal_button gtkinst.cxx 2957 0x7fffe62a1035
22 (anonymous namespace)::GtkInstanceWidget::signalButtonPress gtkinst.cxx 2931 0x7fffe62a0e7a
[...]
At least a simple `git grep GtkMenuItem | grep -v 'id='`
doesn't reveal any other cases with the same problem.
Change-Id: I9d67ff638ee59a6e57a96a2a3ec24095be31d6fa
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186145
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
BASIC IDE Controls and Dialogs
Controls and dialogs for BASIC. Contains the BASIC IDE.