GNOME Bugzilla – Bug 551128
Non-gnome programs that use libgoffice with gnome-support crash on help buttons
Last modified: 2008-09-14 05:49:20 UTC
Steps to reproduce: 1. Use standard libgoffice (with gnome enabled) 2. Compile gnumeric with the option -without-gnome 3. Run gnumeric, open search and replace dialog with crtl-h and click help button. 4. Crash! Stack trace: Other information: A patch will follow.
Created attachment 118164 [details] [review] Patch for libgoffice The call to gnome_help_display crashes a program if it is not a gnome program. Libgoffice (with and without gnome support compiled in) should work well with both gnome and non gnome programs. This patch will fix this for the case where gnome_help_display is used.
Why do you replace: #ifdef GOFFICE_WITH_GNOME ... #elif defined(G_OS_WIN32) ... #endif by: #if defined(G_OS_WIN32) ... #else #ifdef GOFFICE_WITH_GNOME ... #endif #endif ?
(In reply to comment #2) I replaced: #ifdef GOFFICE_WITH_GNOME ... #elif defined(G_OS_WIN32) ... #else go_gtk_notice_dialog... #endif by: #if defined(G_OS_WIN32) ... #else #ifdef GOFFICE_WITH_GNOME if (gnome_program_get != NULL) { .... return; } #endif go_gtk_notice_dialog... #endif Notice the go_gtk_notice_dialog call: through my patch this function is called not only when goffice is compiled _without_ GOFFICE_WITH_GNOME but also when goffice is compiled _with_ GOFFICE_WITH_GNOME while the program using goffice is not a gnome program. To achieve this I have changed the order of the #if's, #ifdef's and #elif's a bit. Looking back at this, I see than I have made the assumption that you cannot have a goffice compiled for win32 (defined(G_OS_WIN32)) with gnome support (defined(GOFFICE_WITH_GNOME)). That assumption might be presumptuous. Next patch will correct this.
Created attachment 118516 [details] [review] New patch for libgoffice This new patch corrects the presumptuous assumption of my previous patch that you cannot have libgoffice with gnome support compiled in on win32.
WITH_GNOME and WIN32 are not compatible. Your first patch is better. Go for it.
(In reply to comment #5) > WITH_GNOME and WIN32 are not compatible. Your first patch is better. Theoretically they could be made compatible in the future I guess. But as it is probably better in the future to remove all gnome use in libgoffice all together, I think it is not worthwhile to patch this with WITH_GNOME and WIN32 compatibility. So I agree with you that the first patch is better. > Go for it. Can you (or someone else) commit this for me, I have no SVN commit access. As this bug causes crashes and data loss in gnumeric and is not very invasive, you might want to commit the patch to the stable branch(es) as well.
First patch commited to both branches. Thanks for the report and the fix.