Fix wxFontDialog exceptions on OS X Yosemite
Opening the font dialog would result in an exception in RunMixedFontDialog: -[NSView resetFlags]: unrecognized selector sent to instance 0x6080001285c0 The code in question assumed that NSFontPanel's accessory view either didn't exist or was created by wx, and casted it to wxMacFontPanelAccView* without checking. But this assumption is no longer true on OS X 10.10, the view is apparently pre-set to some default NSView instance. Fix the code to check accessoryView's class before treating it as wxMacFontPanelAccView. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78070 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
fd9d67e9f4
commit
f97112a21e
@ -158,8 +158,8 @@ int RunMixedFontDialog(wxFontDialog* dialog)
|
||||
[fontPanel setFloatingPanel:NO] ;
|
||||
[[fontPanel standardWindowButton:NSWindowCloseButton] setEnabled:NO] ;
|
||||
|
||||
wxMacFontPanelAccView* accessoryView = (wxMacFontPanelAccView*) [fontPanel accessoryView] ;
|
||||
if ( accessoryView == nil)
|
||||
wxMacFontPanelAccView* accessoryView = nil;
|
||||
if ( [fontPanel accessoryView] == nil || [[fontPanel accessoryView] class] != [wxMacFontPanelAccView class] )
|
||||
{
|
||||
NSRect rectBox = NSMakeRect( 0 , 0 , 192 , 40 );
|
||||
accessoryView = [[wxMacFontPanelAccView alloc] initWithFrame:rectBox];
|
||||
@ -168,6 +168,10 @@ int RunMixedFontDialog(wxFontDialog* dialog)
|
||||
|
||||
[fontPanel setDefaultButtonCell:[[accessoryView okButton] cell]] ;
|
||||
}
|
||||
else
|
||||
{
|
||||
accessoryView = (wxMacFontPanelAccView*)[fontPanel accessoryView];
|
||||
}
|
||||
|
||||
[accessoryView resetFlags];
|
||||
#if wxOSX_USE_COCOA
|
||||
|
Loading…
Reference in New Issue
Block a user