Module: wine Branch: master Commit: f1b7bb4eaaeb1668169877d691a0d984b89a441d URL: http://source.winehq.org/git/wine.git/?a=commit;h=f1b7bb4eaaeb1668169877d691...
Author: Erich Hoover ehoover@mines.edu Date: Tue Sep 27 20:02:11 2011 -0600
hhctrl.ocx: Open a specific topic when requested.
---
dlls/hhctrl.ocx/hhctrl.c | 20 +++++++++++++++----- 1 files changed, 15 insertions(+), 5 deletions(-)
diff --git a/dlls/hhctrl.ocx/hhctrl.c b/dlls/hhctrl.ocx/hhctrl.c index 2747dcb..400f920 100644 --- a/dlls/hhctrl.ocx/hhctrl.c +++ b/dlls/hhctrl.ocx/hhctrl.c @@ -166,15 +166,17 @@ HWND WINAPI HtmlHelpW(HWND caller, LPCWSTR filename, UINT command, DWORD_PTR dat NMHDR nmhdr; const WCHAR *index = NULL; int tab_index = TAB_CONTENTS; + const WCHAR *default_index = NULL;
if (!filename) return NULL;
- if (!resolve_filename(filename, fullname, MAX_PATH, &index, NULL)) + if (!resolve_filename(filename, fullname, MAX_PATH, &default_index, NULL)) { WARN("can't find %s\n", debugstr_w(filename)); return 0; } + index = default_index;
info = CreateHelpViewer(fullname); if(!info) @@ -183,10 +185,20 @@ HWND WINAPI HtmlHelpW(HWND caller, LPCWSTR filename, UINT command, DWORD_PTR dat if(!index) index = info->WinType.pszFile;
+ /* called to load a specified topic */ + switch(command) + { + case HH_DISPLAY_TOPIC: + case HH_DISPLAY_TOC: + if (data) + index = (const WCHAR *)data; + break; + } + res = NavigateToChm(info, info->pCHMInfo->szFile, index);
- if (index != info->WinType.pszFile) - heap_free((WCHAR*)index); + if (default_index) + heap_free((WCHAR*)default_index);
if(!res) { @@ -199,8 +211,6 @@ HWND WINAPI HtmlHelpW(HWND caller, LPCWSTR filename, UINT command, DWORD_PTR dat case HH_DISPLAY_TOPIC: case HH_DISPLAY_TOC: tab_index = TAB_CONTENTS; - if (data) - FIXME("Should jump to topic '%s'.\n", debugstr_w((WCHAR *)data)); break; case HH_DISPLAY_INDEX: tab_index = TAB_INDEX;