From d2acc405fca7c49c8c0197b59aa5c04328cd920d Mon Sep 17 00:00:00 2001 From: "smfr%smfr.org" Date: Tue, 1 Mar 2005 08:18:11 +0000 Subject: [PATCH] Add windowWillReturnFieldEditor: handling to help fix bug 188300, and forward font panel delegate methods to the current pane, for bug 173150. --- .../preferences/MVPreferencesController.mm | 27 ++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/camino/src/preferences/MVPreferencesController.mm b/camino/src/preferences/MVPreferencesController.mm index 109c2d95e318..424dd6a79fe1 100644 --- a/camino/src/preferences/MVPreferencesController.mm +++ b/camino/src/preferences/MVPreferencesController.mm @@ -282,6 +282,14 @@ NSString* const MVPreferencesWindowNotification = @"MVPreferencesWindowNotificat [[self currentPane] didActivate]; } +- (id)windowWillReturnFieldEditor:(NSWindow *)sender toObject:(id)anObject +{ + if ([[self currentPane] respondsToSelector:@selector(fieldEditorForObject:)]) + return [[self currentPane] fieldEditorForObject:anObject]; + + return nil; +} + #pragma mark - - (NSToolbarItem *) toolbar:(NSToolbar *) toolbar @@ -435,7 +443,24 @@ NSString* const MVPreferencesWindowNotification = @"MVPreferencesWindowNotificat - (void)changeFont:(id)sender { - [[self currentPane] changeFont:sender]; + if ([[self currentPane] respondsToSelector:@selector(changeFont:)]) + [[self currentPane] changeFont:sender]; +} + +- (BOOL)fontManager:(id)theFontManager willIncludeFont:(NSString *)fontName +{ + if ([[self currentPane] respondsToSelector:@selector(fontManager:willIncludeFont:)]) + return [[self currentPane] fontManager:theFontManager willIncludeFont:fontName]; + + return YES; +} + +- (unsigned int)validModesForFontPanel:(NSFontPanel *)fontPanel +{ + if ([[self currentPane] respondsToSelector:@selector(validModesForFontPanel:)]) + return [[self currentPane] validModesForFontPanel:fontPanel]; + + return 0xFFFF; // NSFontPanelStandardModesMask } @end