From 2a7566cc4002b5a0d1a894c5ebf9df1a8d5652ab Mon Sep 17 00:00:00 2001 From: Geert Janssens Date: Sun, 26 Sep 2021 22:58:08 +0200 Subject: [PATCH] Win32 - drop conditional code never reached We had hardcoded HAVE_HTMLHELPW to always be true so the fallback code that's only reached when it is false was never reached. Time to drop this dead code. --- CMakeLists.txt | 11 +++++----- common/config.h.cmake.in | 3 --- libgnucash/app-utils/gnc-help-utils.c | 29 ++------------------------- 3 files changed, 7 insertions(+), 36 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index baa0f8df71..b377d97cb0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -668,12 +668,11 @@ install(FILES ${gnucash_DOCS} DESTINATION ${CMAKE_INSTALL_DOCDIR}) # Create config.h if (WIN32) -if (MINGW) -set (HAVE_SCANF_LLD 1) -else () -set (HAVE_SCANF_I64D 1) -endif() -set (HAVE_HTMLHELPW 1) + if (MINGW) + set (HAVE_SCANF_LLD 1) + else () + set (HAVE_SCANF_I64D 1) + endif() endif() check_include_files (dirent.h HAVE_DIRENT_H) diff --git a/common/config.h.cmake.in b/common/config.h.cmake.in index feb0a98f90..979f03572f 100644 --- a/common/config.h.cmake.in +++ b/common/config.h.cmake.in @@ -117,9 +117,6 @@ /* System has gnome-keyring 0.6 or better */ #cmakedefine HAVE_GNOME_KEYRING 1 -/* System has HtmlHelpW */ -#cmakedefine HAVE_HTMLHELPW 1 - /* Define to 1 if you have the header file. */ #cmakedefine HAVE_INTTYPES_H 1 diff --git a/libgnucash/app-utils/gnc-help-utils.c b/libgnucash/app-utils/gnc-help-utils.c index ad5530b377..53e6967517 100644 --- a/libgnucash/app-utils/gnc-help-utils.c +++ b/libgnucash/app-utils/gnc-help-utils.c @@ -24,15 +24,11 @@ #include #include -#ifdef HAVE_HTMLHELPW -# include -# include -#endif +#include +#include #include "gnc-help-utils.h" -#ifdef HAVE_HTMLHELPW - static GHashTable * parse_hhmap_file(const gchar *chmfile) { @@ -137,24 +133,3 @@ gnc_show_htmlhelp(const gchar *chmfile, const gchar *anchor) HtmlHelpW(GetDesktopWindow(), wpath, HH_HELP_CONTEXT, id); g_free(wpath); } - -#else /* !HAVE_HTMLHELPW */ -void -gnc_show_htmlhelp(const gchar *chmfile, const gchar *anchor) -{ - gchar *argv[3]; - - g_return_if_fail(chmfile); - - argv[0] = "hh"; - argv[1] = g_strdup(chmfile); - argv[2] = NULL; - - if (!g_spawn_async(NULL, argv, NULL, G_SPAWN_SEARCH_PATH, - NULL, NULL, NULL, NULL)) - if (g_file_test(chmfile, G_FILE_TEST_IS_REGULAR)) - g_warning("Found CHM help file, but could not spawn hh to open it"); - - g_free(argv[1]); -} -#endif /* HAVE_HTMLHELPW */