X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b7dbd50c8989a64a90a8b6079d52b006b4a003c1..f7d2128f3c89b2d00fbac0d8c9798409ae23b408:/src/mac/carbon/fontdlg.cpp?ds=sidebyside diff --git a/src/mac/carbon/fontdlg.cpp b/src/mac/carbon/fontdlg.cpp index 13909cd946..e7892ad542 100644 --- a/src/mac/carbon/fontdlg.cpp +++ b/src/mac/carbon/fontdlg.cpp @@ -66,7 +66,7 @@ wxMacCarbonFontPanelHandler(EventHandlerCallRef WXUNUSED(nextHandler), OSStatus result = eventNotHandledErr ; wxFontDialog *fontdialog = (wxFontDialog*) userData ; wxFontData& fontdata= fontdialog->GetFontData() ; - + wxMacCarbonEvent cEvent( event ); switch(cEvent.GetKind()) { @@ -92,13 +92,16 @@ wxMacCarbonFontPanelHandler(EventHandlerCallRef WXUNUSED(nextHandler), { FMFontStyle fontStyle = cEvent.GetParameter(kEventParamFMFontStyle); FMFontSize fontSize = cEvent.GetParameter(kEventParamFMFontSize); - + CFStringRef cfName = NULL; #if 1 FMFontFamily fontFamily = cEvent.GetParameter(kEventParamFMFontFamily); ATSFontFamilyRef atsfontfamilyref = FMGetATSFontFamilyRefFromFontFamily( fontFamily ) ; OSStatus err = ATSFontFamilyGetName( atsfontfamilyref , kATSOptionFlagsDefault , &cfName ) ; - wxASSERT_MSG( err == noErr , wxT("ATSFontFamilyGetName failed") ); + if ( err == noErr ) + { + wxFAIL_MSG("ATSFontFamilyGetName failed"); + } #else // we don't use the ATSU naming anymore ByteCount actualLength = 0; @@ -132,7 +135,7 @@ wxMacCarbonFontPanelHandler(EventHandlerCallRef WXUNUSED(nextHandler), #endif if ( cfName!=NULL ) { - fontdata.m_chosenFont.SetFaceName(wxMacCFStringHolder(cfName).AsString(wxLocale::GetSystemEncoding())); + fontdata.m_chosenFont.SetFaceName(wxCFStringRef(cfName).AsString(wxLocale::GetSystemEncoding())); fontdata.m_chosenFont.SetPointSize(fontSize); fontdata.m_chosenFont.SetStyle(fontStyle & italic ? wxFONTSTYLE_ITALIC : wxFONTSTYLE_NORMAL); fontdata.m_chosenFont.SetUnderlined((fontStyle & underline)!=0); @@ -140,7 +143,7 @@ wxMacCarbonFontPanelHandler(EventHandlerCallRef WXUNUSED(nextHandler), } } #endif // wxMAC_USE_ATSU_TEXT - + // retrieving the color RGBColor fontColor ; if ( cEvent.GetParameter(kEventParamFontColor, &fontColor) == noErr ) @@ -181,9 +184,9 @@ wxMacCarbonFontPanelHandler(EventHandlerCallRef WXUNUSED(nextHandler), } } } - break ; - } ; - + break ; + } + return result ; }