hhctrl.ocx: Try to build URL with full path if navigation to URL fails.
This commit is contained in:
parent
e18ddbc0cd
commit
aa1b38c51d
@ -62,11 +62,13 @@ static LPWSTR HH_LoadString(DWORD dwID)
|
|||||||
return string;
|
return string;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL NavigateToUrl(HHInfo *info, LPCWSTR surl)
|
static HRESULT navigate_url(HHInfo *info, LPCWSTR surl)
|
||||||
{
|
{
|
||||||
VARIANT url;
|
VARIANT url;
|
||||||
HRESULT hres;
|
HRESULT hres;
|
||||||
|
|
||||||
|
TRACE("%s\n", debugstr_w(surl));
|
||||||
|
|
||||||
V_VT(&url) = VT_BSTR;
|
V_VT(&url) = VT_BSTR;
|
||||||
V_BSTR(&url) = SysAllocString(surl);
|
V_BSTR(&url) = SysAllocString(surl);
|
||||||
|
|
||||||
@ -74,7 +76,29 @@ BOOL NavigateToUrl(HHInfo *info, LPCWSTR surl)
|
|||||||
|
|
||||||
VariantClear(&url);
|
VariantClear(&url);
|
||||||
|
|
||||||
return SUCCEEDED(hres);
|
if(FAILED(hres))
|
||||||
|
TRACE("Navigation failed: %08lx\n", hres);
|
||||||
|
|
||||||
|
return hres;
|
||||||
|
}
|
||||||
|
|
||||||
|
BOOL NavigateToUrl(HHInfo *info, LPCWSTR surl)
|
||||||
|
{
|
||||||
|
ChmPath chm_path;
|
||||||
|
BOOL ret;
|
||||||
|
HRESULT hres;
|
||||||
|
|
||||||
|
hres = navigate_url(info, surl);
|
||||||
|
if(SUCCEEDED(hres))
|
||||||
|
return TRUE;
|
||||||
|
|
||||||
|
SetChmPath(&chm_path, info->pCHMInfo->szFile, surl);
|
||||||
|
ret = NavigateToChm(info, chm_path.chm_file, chm_path.chm_index);
|
||||||
|
|
||||||
|
hhctrl_free(chm_path.chm_file);
|
||||||
|
hhctrl_free(chm_path.chm_index);
|
||||||
|
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL NavigateToChm(HHInfo *info, LPCWSTR file, LPCWSTR index)
|
BOOL NavigateToChm(HHInfo *info, LPCWSTR file, LPCWSTR index)
|
||||||
@ -84,7 +108,7 @@ BOOL NavigateToChm(HHInfo *info, LPCWSTR file, LPCWSTR index)
|
|||||||
LPWSTR ptr;
|
LPWSTR ptr;
|
||||||
|
|
||||||
static const WCHAR url_format[] =
|
static const WCHAR url_format[] =
|
||||||
{'m','k',':','@','M','S','I','T','S','t','o','r','e',':','%','s',':',':','/','%','s',0};
|
{'m','k',':','@','M','S','I','T','S','t','o','r','e',':','%','s',':',':','%','s',0};
|
||||||
|
|
||||||
TRACE("%p %s %s\n", info, debugstr_w(file), debugstr_w(index));
|
TRACE("%p %s %s\n", info, debugstr_w(file), debugstr_w(index));
|
||||||
|
|
||||||
@ -102,7 +126,7 @@ BOOL NavigateToChm(HHInfo *info, LPCWSTR file, LPCWSTR index)
|
|||||||
if((ptr = strchrW(buf, '#')))
|
if((ptr = strchrW(buf, '#')))
|
||||||
*ptr = 0;
|
*ptr = 0;
|
||||||
|
|
||||||
return NavigateToUrl(info, buf);
|
return SUCCEEDED(navigate_url(info, buf));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Size Bar */
|
/* Size Bar */
|
||||||
@ -892,6 +916,8 @@ static BOOL CreateViewer(HHInfo *pHHInfo)
|
|||||||
|
|
||||||
void ReleaseHelpViewer(HHInfo *info)
|
void ReleaseHelpViewer(HHInfo *info)
|
||||||
{
|
{
|
||||||
|
TRACE("(%p)\n", info);
|
||||||
|
|
||||||
if (!info)
|
if (!info)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user