From 5d713a7574bfabba6671a0dca00ecf0ca324fdf3 Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Fri, 7 Mar 2008 19:38:01 +0000 Subject: [PATCH] cleaning up common OSX code git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@52378 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/utilscmn.cpp | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/src/common/utilscmn.cpp b/src/common/utilscmn.cpp index c3b7898538..dd052b5c90 100644 --- a/src/common/utilscmn.cpp +++ b/src/common/utilscmn.cpp @@ -1055,29 +1055,17 @@ bool wxLaunchDefaultBrowser(const wxString& urlOrig, int flags) // because the code must use Objective-C features. return wxCocoaLaunchDefaultBrowser(url, flags); #elif defined(__WXMAC__) - OSStatus err; - ICInstance inst; - long int startSel; - long int endSel; + wxCFRef< CFURLRef > curl( CFURLCreateWithString( kCFAllocatorDefault, + wxCFStringRef( url ), NULL ) ); + OSStatus err = LSOpenCFURLRef( curl , NULL ); - err = ICStart(&inst, 'STKA'); // put your app creator code here if (err == noErr) { - if (err == noErr) - { - ConstStr255Param hint = 0; - startSel = 0; - endSel = url.length(); - err = ICLaunchURL(inst, hint, url.fn_str(), endSel, &startSel, &endSel); - if (err != noErr) - wxLogDebug(wxT("ICLaunchURL error %d"), (int) err); - } - ICStop(inst); return true; } else { - wxLogDebug(wxT("ICStart error %d"), (int) err); + wxLogDebug(wxT("Browser Launch error %d"), (int) err); return false; } #else -- 2.45.2