Fix for broken wxMSWUniv after wxLaunchDefaultBrowser introduction. Source cleaning (should not happen in new code).
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@33879 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -539,7 +539,8 @@ bool wxLaunchDefaultBrowser(const wxString& url)
|
||||
if(wxURI(url).IsReference())
|
||||
finalurl = wxString(wxT("http://")) + url;
|
||||
|
||||
#ifdef __WINDOWS__
|
||||
#if defined(__WXMSW__) && wxUSE_CONFIG_NATIVE
|
||||
|
||||
wxString command;
|
||||
|
||||
// ShellExecute() always opens in the same window,
|
||||
@@ -560,10 +561,10 @@ bool wxLaunchDefaultBrowser(const wxString& url)
|
||||
// this is a bit naive but should work as -1 can't appear
|
||||
// elsewhere in the DDE topic, normally
|
||||
if ( ddeCmd.Replace(wxT("-1"), wxT("0"),
|
||||
FALSE /* only first occurence */) == 1 )
|
||||
false /* only first occurence */) == 1 )
|
||||
{
|
||||
// and also replace the parameters
|
||||
if ( ddeCmd.Replace(wxT("%1"), url, FALSE) == 1 )
|
||||
if ( ddeCmd.Replace(wxT("%1"), url, false) == 1 )
|
||||
{
|
||||
// magic incantation understood by wxMSW
|
||||
command << wxT("WX_DDE#")
|
||||
@@ -633,11 +634,10 @@ bool wxLaunchDefaultBrowser(const wxString& url)
|
||||
#endif
|
||||
}
|
||||
|
||||
#else
|
||||
#if wxUSE_MIMETYPE
|
||||
#elif wxUSE_MIMETYPE
|
||||
|
||||
// Non-windows way
|
||||
wxFileType *ft =
|
||||
wxTheMimeTypesManager->GetFileTypeFromExtension (_T("html"));
|
||||
wxFileType *ft = wxTheMimeTypesManager->GetFileTypeFromExtension (_T("html"));
|
||||
if (!ft)
|
||||
{
|
||||
wxLogError(_T("No default application can open .html extension"));
|
||||
@@ -648,10 +648,7 @@ bool wxLaunchDefaultBrowser(const wxString& url)
|
||||
ft->GetMimeType(&mt);
|
||||
|
||||
wxString cmd;
|
||||
bool ok =
|
||||
ft->GetOpenCommand (&cmd,
|
||||
wxFileType::MessageParameters (finalurl.c_str(),
|
||||
_T("")));
|
||||
bool ok = ft->GetOpenCommand (&cmd, wxFileType::MessageParameters(finalurl));
|
||||
delete ft;
|
||||
|
||||
if (ok)
|
||||
@@ -664,9 +661,10 @@ bool wxLaunchDefaultBrowser(const wxString& url)
|
||||
}
|
||||
else
|
||||
return false;
|
||||
#else
|
||||
|
||||
#else // !wxUSE_MIMETYPE && !(WXMSW && wxUSE_NATIVE_CONFIG)
|
||||
|
||||
return false;
|
||||
#endif //!wxUSE_MIMETYPE
|
||||
|
||||
#endif
|
||||
|
||||
|
Reference in New Issue
Block a user