Changeset 14631


Ignore:
Timestamp:
Dec 22, 2015, 12:45:09 AM (6 years ago)
Author:
mikedld
Message:

#6039: Fix uninitialized controlView use in InfoTabButtonCell?

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/InfoTabButtonCell.m

    r13251 r14631  
    2929- (void) awakeFromNib
    3030{
    31     [(NSMatrix *)[self controlView] setToolTip: [self title] forCell: self];
    32    
    3331    NSNotificationCenter * nc = [NSNotificationCenter defaultCenter];
    3432    [nc addObserver: self selector: @selector(updateControlTint:)
     
    3937    //expects the icon to currently be set as the image
    4038    fIcon = [[self image] retain];
    41     [self setSelectedTab: fSelected];
    4239}
    4340
     
    5047}
    5148
     49- (void) setControlView: (NSView *) controlView
     50{
     51    const BOOL hadControlView = [self controlView] != nil;
     52
     53    [super setControlView: controlView];
     54
     55    if (!hadControlView)
     56    {
     57        [(NSMatrix *)[self controlView] setToolTip: [self title] forCell: self];
     58        [self setSelectedTab: fSelected];
     59    }
     60}
     61
    5262- (void) setSelectedTab: (BOOL) selected
    5363{
    5464    fSelected = selected;
    5565   
     66    if ([self controlView] == nil)
     67        return;
     68
    5669    NSInteger row, col;
    5770    [(NSMatrix *)[self controlView] getRow: &row column: &col ofCell: self];
Note: See TracChangeset for help on using the changeset viewer.