Chromium Code Reviews| Index: chrome/browser/cocoa/keyword_editor_cocoa_controller.mm |
| diff --git a/chrome/browser/cocoa/keyword_editor_cocoa_controller.mm b/chrome/browser/cocoa/keyword_editor_cocoa_controller.mm |
| index 4198cf0a25299a59e733ea8749671999db875ecf..184e5e3dfcbdcd668a1296f2662f76fbac2fd77d 100644 |
| --- a/chrome/browser/cocoa/keyword_editor_cocoa_controller.mm |
| +++ b/chrome/browser/cocoa/keyword_editor_cocoa_controller.mm |
| @@ -69,7 +69,9 @@ void KeywordEditorModelObserver::OnItemsChanged(int start, int length) { |
| } |
| void KeywordEditorModelObserver::OnItemsAdded(int start, int length) { |
| - DCHECK_LE(start, static_cast<int>([iconImages_ count])); |
| + const NSUInteger count([iconImages_ count]); |
| + DCHECK_LE(start, static_cast<int>(count)); |
| + [iconImages_ setCount:count + length]; |
|
Scott Hess - ex-Googler
2009/10/09 02:20:43
This will add length items to iconImages_ and the
pink (ping after 24hrs)
2009/10/09 14:50:38
i don't follow why you need to do this.
Scott Hess - ex-Googler
2009/10/09 14:54:16
-[NSPointerArray insertPointer:atIndex:] requires
|
| for (int i = 0; i < length; ++i) { |
| [iconImages_ insertPointer:NULL atIndex:start]; // Values slide down. |
| } |
| @@ -128,6 +130,8 @@ void KeywordEditorModelObserver::InvalidateIconCache(int start, int length) { |
| - (void)dealloc { |
| controller_->table_model()->SetObserver(NULL); |
| controller_->url_model()->RemoveObserver(observer_.get()); |
| + [tableView_ setTarget:nil]; |
|
Scott Hess - ex-Googler
2009/10/09 02:20:43
If you're going to clear target, clear dataSource,
|
| + observer_.reset(); |
| [super dealloc]; |
| } |
| @@ -169,6 +173,7 @@ void KeywordEditorModelObserver::InvalidateIconCache(int start, int length) { |
| - (void)modelChanged { |
|
Scott Hess - ex-Googler
2009/10/09 14:54:16
To help catch out-of-sync issues (which is what ha
|
| [tableView_ reloadData]; |
| + [self adjustEditingButtons]; |
| } |
| - (KeywordEditorController*)controller { |