From 5ad98e7ac076c81a4f8fde424f3e0422486ceb31 Mon Sep 17 00:00:00 2001 From: "smfr%smfr.org" Date: Tue, 25 Jan 2005 04:54:59 +0000 Subject: [PATCH] Fix bug 279664: fix controlTextDidChange notifications from the SearchTextField. Thanks to olivier@umich.edu for the fix. --- camino/src/bookmarks/BookmarkViewController.mm | 7 +------ camino/src/browser/SearchTextField.m | 9 ++++----- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/camino/src/bookmarks/BookmarkViewController.mm b/camino/src/bookmarks/BookmarkViewController.mm index e4eac3b41c77..07f616ebee43 100644 --- a/camino/src/bookmarks/BookmarkViewController.mm +++ b/camino/src/bookmarks/BookmarkViewController.mm @@ -1456,12 +1456,7 @@ static const int kDisabledQuicksearchPopupItemTag = 9999; // called when the user typed into the quicksearch field, or edits an item inline - (void)controlTextDidChange:(NSNotification *)aNotification { - // how can I tell if this is coming from the quicksearch field? - // the object seems to be the field editor in that situation - - // currently, ignore all notifications coming from table views (including - // outline views), to avoid responding because of inline editing. - if (![[aNotification object] isKindOfClass:[NSTableView class]]) + if ([aNotification object] == mSearchField) { NSString* currentText = [mSearchField stringValue]; [self searchStringChanged:currentText]; diff --git a/camino/src/browser/SearchTextField.m b/camino/src/browser/SearchTextField.m index 23bd708e3c1b..8d8d72038079 100644 --- a/camino/src/browser/SearchTextField.m +++ b/camino/src/browser/SearchTextField.m @@ -63,8 +63,9 @@ if (NSMouseInRect(pointInField, [[self cell] cancelButtonRectFromRect:cellFrame], NO)) { [[self cell] cancelButtonClickedWithFrame:cellFrame inView:self]; - // fake the notification - [self textDidChange:[NSNotification notificationWithName:NSControlTextDidChangeNotification object:self]]; + // fake the notification as close as we can + [self textDidChange: [NSNotification notificationWithName: NSTextDidChangeNotification + object: [self currentEditor]]]; } else if (NSMouseInRect(pointInField, [[self cell] popUpButtonRectFromRect:cellFrame], NO)) { @@ -146,9 +147,7 @@ - (void)textDidChange:(NSNotification *)aNotification { [[self cell] searchSubmittedFromView:self]; - - if ([[self delegate] respondsToSelector:@selector(controlTextDidChange:)]) - [[self delegate] controlTextDidChange:aNotification]; + [super textDidChange: aNotification]; } - (NSString *)titleOfSelectedPopUpItem