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.
This commit is contained in:
Geert Janssens 2021-09-26 22:58:08 +02:00
parent c17d43ba83
commit 2a7566cc40
3 changed files with 7 additions and 36 deletions

View File

@ -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)

View File

@ -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 <inttypes.h> header file. */
#cmakedefine HAVE_INTTYPES_H 1

View File

@ -24,15 +24,11 @@
#include <config.h>
#include <glib.h>
#ifdef HAVE_HTMLHELPW
# include <windows.h>
# include <htmlhelp.h>
#endif
#include <windows.h>
#include <htmlhelp.h>
#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 */