Erich Hoover : hhctrl.ocx: Fix displaying the first page for some help files.
Alexandre Julliard
julliard at winehq.org
Thu Jun 14 15:31:32 CDT 2012
Module: wine
Branch: master
Commit: e412c8c7b815271f248936e0a07a1fdc0970129c
URL: http://source.winehq.org/git/wine.git/?a=commit;h=e412c8c7b815271f248936e0a07a1fdc0970129c
Author: Erich Hoover <ehoover at mines.edu>
Date: Thu Jun 14 09:44:08 2012 -0600
hhctrl.ocx: Fix displaying the first page for some help files.
---
dlls/hhctrl.ocx/chm.c | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/dlls/hhctrl.ocx/chm.c b/dlls/hhctrl.ocx/chm.c
index af4fb19..f040e5d 100644
--- a/dlls/hhctrl.ocx/chm.c
+++ b/dlls/hhctrl.ocx/chm.c
@@ -251,6 +251,7 @@ BOOL LoadWinTypeFromCHM(HHInfo *info)
HRESULT hr;
DWORD cbRead;
+ static const WCHAR null[] = {0};
static const WCHAR toc_extW[] = {'h','h','c',0};
static const WCHAR index_extW[] = {'h','h','k',0};
static const WCHAR windowsW[] = {'#','W','I','N','D','O','W','S',0};
@@ -260,7 +261,6 @@ BOOL LoadWinTypeFromCHM(HHInfo *info)
{
/* no defined window types so use (hopefully) sane defaults */
static const WCHAR defaultwinW[] = {'d','e','f','a','u','l','t','w','i','n','\0'};
- static const WCHAR null[] = {0};
memset((void*)&(info->WinType), 0, sizeof(info->WinType));
info->WinType.cbStruct=sizeof(info->WinType);
info->WinType.fUniCodeStrings=TRUE;
@@ -292,13 +292,16 @@ BOOL LoadWinTypeFromCHM(HHInfo *info)
info->WinType.pszType = info->pszType = strdupAtoW(GetChmString(info->pCHMInfo, (DWORD_PTR)info->WinType.pszType));
info->WinType.pszCaption = info->pszCaption = strdupAtoW(GetChmString(info->pCHMInfo, (DWORD_PTR)info->WinType.pszCaption));
- info->WinType.pszFile = info->pszFile = strdupAtoW(GetChmString(info->pCHMInfo, (DWORD_PTR)info->WinType.pszFile));
info->WinType.pszHome = info->pszHome = strdupAtoW(GetChmString(info->pCHMInfo, (DWORD_PTR)info->WinType.pszHome));
info->WinType.pszJump1 = info->pszJump1 = strdupAtoW(GetChmString(info->pCHMInfo, (DWORD_PTR)info->WinType.pszJump1));
info->WinType.pszJump2 = info->pszJump2 = strdupAtoW(GetChmString(info->pCHMInfo, (DWORD_PTR)info->WinType.pszJump2));
info->WinType.pszUrlJump1 = info->pszUrlJump1 = strdupAtoW(GetChmString(info->pCHMInfo, (DWORD_PTR)info->WinType.pszUrlJump1));
info->WinType.pszUrlJump2 = info->pszUrlJump2 = strdupAtoW(GetChmString(info->pCHMInfo, (DWORD_PTR)info->WinType.pszUrlJump2));
+ if (info->WinType.pszFile)
+ info->WinType.pszFile = info->pszFile = strdupAtoW(GetChmString(info->pCHMInfo, (DWORD_PTR)info->WinType.pszFile));
+ else
+ info->WinType.pszFile = strdupW(info->pCHMInfo->defTopic ? info->pCHMInfo->defTopic : null);
if (info->WinType.pszToc)
info->WinType.pszToc = info->pszToc = strdupAtoW(GetChmString(info->pCHMInfo, (DWORD_PTR)info->WinType.pszToc));
else
More information about the wine-cvs
mailing list