diff options
author | gtm.daemon <gtm.daemon@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3> | 2009-09-16 21:00:19 +0000 |
---|---|---|
committer | gtm.daemon <gtm.daemon@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3> | 2009-09-16 21:00:19 +0000 |
commit | d9679f3c7cc21cf4a0c1400a838b723dc5cf37c1 (patch) | |
tree | 6f6db73dcf41d71e47f95faa1b8ed246a285be5b /AppKit/GTMWindowSheetController.m | |
parent | a6af758d94658190533c50e1d25c0d34997b5561 (diff) |
[Author: thomasvl]
Use class membership instead of string match.
R=mmentovai,avi
DELTA=6 (3 added, 0 deleted, 3 changed)
Diffstat (limited to 'AppKit/GTMWindowSheetController.m')
-rw-r--r-- | AppKit/GTMWindowSheetController.m | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/AppKit/GTMWindowSheetController.m b/AppKit/GTMWindowSheetController.m index c69c158..ae14685 100644 --- a/AppKit/GTMWindowSheetController.m +++ b/AppKit/GTMWindowSheetController.m @@ -449,11 +449,14 @@ willPositionSheet:(NSWindow*)sheet static const size_t kGTMWSCSystemSheetInfoDataSize = sizeof(kGTMWSCSystemSheetInfoData)/sizeof(kGTMWSCSystemSheetInfoData[0]); - NSString* className = NSStringFromClass([systemSheet class]); - for (size_t i = 0; i < kGTMWSCSystemSheetInfoDataSize; ++i) - if ([kGTMWSCSystemSheetInfoData[i].className_ isEqualToString:className]) + for (size_t i = 0; i < kGTMWSCSystemSheetInfoDataSize; ++i) { + Class testClass = + NSClassFromString(kGTMWSCSystemSheetInfoData[i].className_); + if (testClass && [systemSheet isKindOfClass:testClass]) { return &kGTMWSCSystemSheetInfoData[i]; - + } + } + _GTMDevLog(@"Failed to find info for sheet of type %@", [systemSheet class]); return nil; } |