X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/88a7a4e10ed18f81a576dcd866cfbf02bf404c00..0bbe61b8c18a1795189f0cf73cc61c14a0fb846d:/src/mac/carbon/fontdlgosx.mm?ds=sidebyside diff --git a/src/mac/carbon/fontdlgosx.mm b/src/mac/carbon/fontdlgosx.mm index 043439c64f..55071430b2 100644 --- a/src/mac/carbon/fontdlgosx.mm +++ b/src/mac/carbon/fontdlgosx.mm @@ -23,11 +23,11 @@ #ifndef WX_PRECOMP #include "wx/intl.h" + #include "wx/log.h" + #include "wx/cmndata.h" #endif -#include "wx/cmndata.h" #include "wx/fontutil.h" -#include "wx/log.h" // ============================================================================ // implementation @@ -65,14 +65,14 @@ { [super initWithFrame:rectBox]; - wxMacCFStringHolder cfOkString( wxT("OK"), wxLocale::GetSystemEncoding() ); - wxMacCFStringHolder cfCancelString( wxT("Cancel"), wxLocale::GetSystemEncoding() ); + wxCFStringRef cfOkString( wxT("OK"), wxLocale::GetSystemEncoding() ); + wxCFStringRef cfCancelString( wxT("Cancel"), wxLocale::GetSystemEncoding() ); NSRect rectCancel = NSMakeRect( 10.0 , 10.0 , 82 , 24 ); NSRect rectOK = NSMakeRect( 100.0 , 10.0 , 82 , 24 ); NSButton* cancelButton = [[NSButton alloc] initWithFrame:rectCancel]; - [cancelButton setTitle:(NSString*)cfCancelString.Detach()]; + [cancelButton setTitle:(NSString*)wxCFRetain((CFStringRef)cfCancelString)]; [cancelButton setBezelStyle:NSRoundedBezelStyle]; [cancelButton setButtonType:NSMomentaryPushInButton]; [cancelButton setAction:@selector(cancelPressed:)]; @@ -80,7 +80,7 @@ m_cancelButton = cancelButton ; NSButton* okButton = [[NSButton alloc] initWithFrame:rectOK]; - [okButton setTitle:(NSString*)cfOkString.Detach()]; + [okButton setTitle:(NSString*)wxCFRetain((CFStringRef)cfOkString)]; [okButton setBezelStyle:NSRoundedBezelStyle]; [okButton setButtonType:NSMomentaryPushInButton]; [okButton setAction:@selector(okPressed:)]; @@ -105,12 +105,14 @@ - (IBAction)cancelPressed:(id)sender { + wxUnusedVar(sender); m_shouldClose = YES ; [NSApp stopModal]; } - (IBAction)okPressed:(id)sender { + wxUnusedVar(sender); m_okPressed = YES ; m_shouldClose = YES ; [NSApp stopModal]; @@ -135,12 +137,14 @@ extern "C" int RunMixedFontDialog(wxFontDialog* dialog) ; -int RunMixedFontDialog(wxFontDialog* dialog) +int RunMixedFontDialog(wxFontDialog* WXUNUSED(dialog)) { int retval = wxID_CANCEL ; - bool cocoaLoaded = NSApplicationLoad(); - wxASSERT_MSG(cocoaLoaded,wxT("Couldn't load Cocoa in Carbon Environment")) ; + if ( !NSApplicationLoad() ) + { + wxFAIL_MSG("Couldn't load Cocoa in Carbon Environment"); + } wxAutoNSAutoreleasePool pool;