From 0f4a938dfc4ef7c94331d46b6c3aaa0810cef83d Mon Sep 17 00:00:00 2001 From: Alexandre Wilhelm Date: Fri, 5 Dec 2014 09:50:49 -0800 Subject: [PATCH] Fixed: attributes of the listDelegate of a CPComboBox could crash cappuccino --- AppKit/CPComboBox.j | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/AppKit/CPComboBox.j b/AppKit/CPComboBox.j index bfc7887ef..a9bc2353f 100644 --- a/AppKit/CPComboBox.j +++ b/AppKit/CPComboBox.j @@ -160,7 +160,7 @@ var CPComboBoxTextSubview = @"text", - (void)setIntercellSpacing:(CGSize)aSize { - if (!aSize || (_intercellSpacing && CGSizeEqualToSize(aSize, _intercellSpacing))) + if (_intercellSpacing && CGSizeEqualToSize(aSize, _intercellSpacing)) return; _intercellSpacing = aSize; @@ -408,9 +408,12 @@ var CPComboBoxTextSubview = @"text", [_listDelegate setFont:[self font]]; [_listDelegate setAlignment:[self alignment]]; - [self setHasVerticalScroller:_hasVerticalScroller]; - [self setIntercellSpacing:_intercellSpacing]; - [self setItemHeight:_itemHeight]; + [[_listDelegate scrollView] setHasVerticalScroller:_hasVerticalScroller]; + + if (_intercellSpacing) + [[_listDelegate tableView] setIntercellSpacing:_intercellSpacing]; + + [[_listDelegate tableView] setRowHeight:_itemHeight]; } - (void)_addObserversForListDelegate:(_CPPopUpList)aDelegate