From 1d5c21fa7213e4cb3fff2d1f46865752d84b5ae2 Mon Sep 17 00:00:00 2001 From: Ross Boucher Date: Tue, 27 Apr 2010 10:48:34 -0700 Subject: [PATCH] If we decode a scroll view without a header clip view, create one. --- AppKit/CPScrollView.j | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/AppKit/CPScrollView.j b/AppKit/CPScrollView.j index b55931abf..26b837414 100644 --- a/AppKit/CPScrollView.j +++ b/AppKit/CPScrollView.j @@ -445,9 +445,7 @@ - (CPView)_headerView { - var headerClipViewSubviews = [_headerClipView subviews]; - - return [headerClipViewSubviews count] ? headerClipViewSubviews[0] : nil; + return [_headerClipView documentView]; } - (CGRect)_cornerViewFrame @@ -776,7 +774,13 @@ var CPScrollViewContentViewKey = "CPScrollViewContentView", _contentView = [aCoder decodeObjectForKey:CPScrollViewContentViewKey]; _headerClipView = [aCoder decodeObjectForKey:CPScrollViewHeaderClipViewKey]; - + + if (!_headerClipView) + { + _headerClipView = [[CPClipView alloc] init]; + [self addSubview:_headerClipView]; + } + _verticalScroller = [aCoder decodeObjectForKey:CPScrollViewVScrollerKey]; _horizontalScroller = [aCoder decodeObjectForKey:CPScrollViewHScrollerKey];