Replace direct use of the isa pointer with a call to object_getClass()

to make David happy.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@33545 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Fred Kiefer 2011-07-14 07:17:24 +00:00
parent 3958406375
commit 86ff6abf69
15 changed files with 60 additions and 37 deletions

View file

@ -1,3 +1,21 @@
2011-07-14 Fred Kiefer <FredKiefer@gmx.de>
* Source/NSSound.m
* Source/GSWindowDecorationView.m
* Source/NSMatrix.m
* Source/NSBitmapImageRep.m
* Source/NSForm.m
* Source/GSHorizontalTypesetter.m
* Source/NSMovie.m
* Source/NSFontDescriptor.m
* Source/NSImage.m
* Source/NSScrollView.m
* Source/NSCell.m
* Source/NSBrowserCell.m
* Source/GSDragView.m
* Source/NSDocument.m: Replace direct use of the isa pointer with
a call to object_getClass().
2011-07-13 Eric Wasylishen <ewasylishen@gmail.com>
* Source/NSColorPanel.m: Make a magnifying glass cursor when using

View file

@ -141,7 +141,7 @@ static GSDragView *sharedDragView = nil;
if (self != nil)
{
NSRect winRect = {{0, 0}, {DWZ, DWZ}};
NSWindow *sharedDragWindow = [[[isa windowClass] alloc]
NSWindow *sharedDragWindow = [[[object_getClass(self) windowClass] alloc]
initWithContentRect: winRect
styleMask: NSBorderlessWindowMask
backing: NSBackingStoreNonretained

View file

@ -1210,7 +1210,7 @@ restart: ;
we create a new instance and let it handle the call. */
GSHorizontalTypesetter *temp;
temp = [[isa alloc] init];
temp = [[object_getClass(self) alloc] init];
ret = [temp layoutGlyphsInLayoutManager: layoutManager
inTextContainer: textContainer
startingAtGlyphIndex: glyphIndex

View file

@ -155,8 +155,9 @@ static inline NSRect RectWithSizeScaledByFactor(NSRect aRect, CGFloat factor)
window = w;
// Content rect will be everything apart from the border
// that is including menu, toolbar and the like.
contentRect = [isa contentRectForFrameRect: frame
styleMask: [w styleMask]];
contentRect = [object_getClass(self)
contentRectForFrameRect: frame
styleMask: [w styleMask]];
}
return self;
}
@ -184,8 +185,9 @@ static inline NSRect RectWithSizeScaledByFactor(NSRect aRect, CGFloat factor)
- (NSRect) contentRectForFrameRect: (NSRect)aRect
styleMask: (unsigned int)aStyle
{
NSRect content = [isa contentRectForFrameRect: aRect
styleMask: aStyle];
NSRect content = [object_getClass(self)
contentRectForFrameRect: aRect
styleMask: aStyle];
NSToolbar *tb = [_window toolbar];
if ([_window menu] != nil)
@ -228,8 +230,8 @@ static inline NSRect RectWithSizeScaledByFactor(NSRect aRect, CGFloat factor)
aRect.size.height += [tv _heightFromLayout];
}
return [isa frameRectForContentRect: aRect
styleMask: aStyle];
return [object_getClass(self) frameRectForContentRect: aRect
styleMask: aStyle];
}
/* If the contentView is removed from the window we must make sure the
@ -286,8 +288,9 @@ static inline NSRect RectWithSizeScaledByFactor(NSRect aRect, CGFloat factor)
NSView *windowContentView = [_window contentView];
frame.origin = NSZeroPoint;
contentViewFrame = [isa contentRectForFrameRect: frame
styleMask: [window styleMask]];
contentViewFrame = [object_getClass(self)
contentRectForFrameRect: frame
styleMask: [window styleMask]];
if (hasMenu)
{
@ -346,8 +349,9 @@ static inline NSRect RectWithSizeScaledByFactor(NSRect aRect, CGFloat factor)
NSRect windowContentFrame;
contentRect.size.height += difference;
windowFrame = [isa frameRectForContentRect: contentRect
styleMask: [window styleMask]];
windowFrame = [object_getClass(self)
frameRectForContentRect: contentRect
styleMask: [window styleMask]];
// Set the local frame without changing the contents view
windowContentFrame = windowFrame;
@ -377,8 +381,9 @@ static inline NSRect RectWithSizeScaledByFactor(NSRect aRect, CGFloat factor)
_autoresizes_subviews = NO;
[super setFrame: frameRect];
contentRect = [isa contentRectForFrameRect: frameRect
styleMask: [window styleMask]];
contentRect = [object_getClass(self)
contentRectForFrameRect: frameRect
styleMask: [window styleMask]];
// Safety Check.
[cv setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable];

View file

@ -295,22 +295,22 @@
return nil;
}
if ([isa _bitmapIsPNG: imageData])
if ([object_getClass(self) _bitmapIsPNG: imageData])
return [self _initBitmapFromPNG: imageData];
if ([isa _bitmapIsPNM: imageData])
if ([object_getClass(self) _bitmapIsPNM: imageData])
return [self _initBitmapFromPNM: imageData
errorMessage: NULL];
if ([isa _bitmapIsJPEG: imageData])
if ([object_getClass(self) _bitmapIsJPEG: imageData])
return [self _initBitmapFromJPEG: imageData
errorMessage: NULL];
if ([isa _bitmapIsGIF: imageData])
if ([object_getClass(self) _bitmapIsGIF: imageData])
return [self _initBitmapFromGIF: imageData
errorMessage: NULL];
if ([isa _bitmapIsICNS: imageData])
if ([object_getClass(self) _bitmapIsICNS: imageData])
return [self _initBitmapFromICNS: imageData];
image = NSTiffOpenDataRead((char *)[imageData bytes], [imageData length]);

View file

@ -274,7 +274,7 @@ static NSFont *_leafFont;
backColor = [self highlightColorInView: controlView];
[backColor set];
if (!_browsercell_is_leaf)
branch_image = [isa highlightedBranchImage];
branch_image = [object_getClass(self) highlightedBranchImage];
cell_image = [self alternateImage];
}
else
@ -282,7 +282,7 @@ static NSFont *_leafFont;
backColor = [cvWin backgroundColor];
[backColor set];
if (!_browsercell_is_leaf)
branch_image = [isa branchImage];
branch_image = [object_getClass(self) branchImage];
cell_image = [self image];
}

View file

@ -177,8 +177,8 @@ static NSColor *dtxtCol;
//_cell.state = 0;
//_cell.line_break_mode = NSLineBreakByWordWrapping;
_action_mask = NSLeftMouseUpMask;
_menu = [isa defaultMenu];
[self setFocusRingType: [isa defaultFocusRingType]];
_menu = [object_getClass(self) defaultMenu];
[self setFocusRingType: [object_getClass(self) defaultFocusRingType]];
return self;
}
@ -208,8 +208,8 @@ static NSColor *dtxtCol;
//_cell.is_selectable = NO;
//_cell.line_break_mode = NSLineBreakByWordWrapping;
_action_mask = NSLeftMouseUpMask;
_menu = [isa defaultMenu];
[self setFocusRingType: [isa defaultFocusRingType]];
_menu = [object_getClass(self) defaultMenu];
[self setFocusRingType: [object_getClass(self) defaultFocusRingType]];
return self;
}

View file

@ -1250,7 +1250,7 @@ originalContentsURL: (NSURL *)orig
- (NSArray *) writableTypesForSaveOperation: (NSSaveOperationType)op
{
NSArray *types = [isa writableTypes];
NSArray *types = [object_getClass(self) writableTypes];
NSMutableArray *muTypes;
int i, len;

View file

@ -83,7 +83,7 @@
[m addEntriesFromDictionary: attributes];
new = [isa fontDescriptorWithFontAttributes: m];
new = [object_getClass(self) fontDescriptorWithFontAttributes: m];
RELEASE(m);
return new;
@ -184,7 +184,7 @@
- (id) copyWithZone: (NSZone *)z
{
NSFontDescriptor *f = [isa allocWithZone: z];
NSFontDescriptor *f = [object_getClass(self) allocWithZone: z];
if (f != nil)
{

View file

@ -110,7 +110,7 @@ static Class defaultCellClass = nil;
- (NSFormCell*) insertEntry: (NSString*)title
atIndex: (int)index
{
NSFormCell *new_cell = [[[isa cellClass] alloc] initTextCell: title];
NSFormCell *new_cell = [[[object_getClass(self) cellClass] alloc] initTextCell: title];
[self insertRow: index];
[self putCell: new_cell atRow: index column: 0];

View file

@ -2189,7 +2189,7 @@ iterate_reps_for_types(NSArray* imageReps, SEL method)
ext = [[fileName pathExtension] lowercaseString];
if (!ext)
return NO;
array = [isa imageFileTypes];
array = [object_getClass(self) imageFileTypes];
if ([array indexOfObject: ext] == NSNotFound)
return NO;

View file

@ -249,7 +249,7 @@ static SEL getSel;
{
return [self initWithFrame: NSZeroRect
mode: NSRadioModeMatrix
cellClass: [isa cellClass]
cellClass: [object_getClass(self) cellClass]
numberOfRows: 0
numberOfColumns: 0];
}
@ -263,7 +263,7 @@ static SEL getSel;
{
return [self initWithFrame: frameRect
mode: NSRadioModeMatrix
cellClass: [isa cellClass]
cellClass: [object_getClass(self) cellClass]
numberOfRows: 0
numberOfColumns: 0];
}
@ -2894,7 +2894,7 @@ static SEL getSel;
if (_cellPrototype == nil)
{
[self setCellClass: [isa cellClass]];
[self setCellClass: [object_getClass(self) cellClass]];
}
[aDecoder decodeValueOfObjCType: @encode (int) at: &rows];

View file

@ -95,7 +95,7 @@
NSData* data;
type = [pasteboard availableTypeFromArray:
[isa movieUnfilteredPasteboardTypes]];
[object_getClass(self) movieUnfilteredPasteboardTypes]];
if (type == nil)
{
//NSArray *array = [pasteboard propertyListForType: NSFilenamesPboardType];

View file

@ -959,7 +959,7 @@ static float scrollerWidth;
_hasHorizRuler = flag;
if (_hasHorizRuler && _horizRuler == nil)
{
_horizRuler = [[isa rulerViewClass] alloc];
_horizRuler = [[object_getClass(self) rulerViewClass] alloc];
_horizRuler = [_horizRuler initWithScrollView: self
orientation: NSHorizontalRuler];
}
@ -1010,7 +1010,7 @@ static float scrollerWidth;
_hasVertRuler = flag;
if (_hasVertRuler && _vertRuler == nil)
{
_vertRuler = [[isa rulerViewClass] alloc];
_vertRuler = [[object_getClass(self) rulerViewClass] alloc];
_vertRuler = [_vertRuler initWithScrollView: self
orientation: NSVerticalRuler];
}

View file

@ -332,7 +332,7 @@ static inline void _loadNSSoundPlugIns (void)
- (id) initWithPasteboard: (NSPasteboard *)pasteboard
{
if ([isa canInitWithPasteboard: pasteboard] == YES)
if ([object_getClass(self) canInitWithPasteboard: pasteboard] == YES)
{
/* FIXME: Should this be @"NSGeneralPboardType" or @"NSSoundPboardType"?
Apple also defines "NSString *NSSoundPboardType". */