diff --git a/ChangeLog b/ChangeLog index 6f7a72ac1..425ff4b66 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2004-02-26 Fred Kiefer + + * Source/NSApplication.m: (-beginSheet:...contextInfo:) + Corrected signature of didEnd function. + * Source/NSMenu.m: (-update) + Tried to handle case for autoenabling correctly where a popup + button doesn't have an action. + * Source/NSBezierPath.m: (-contributionToContains:) + * Source/NSStringDrawing.m: (cache_match()) + Replaced random() with rand() to increase portability. + 2004-02-24 Quentin Mathé committed by Gregory John Casamento diff --git a/Source/NSApplication.m b/Source/NSApplication.m index c95150905..ee2e99be2 100644 --- a/Source/NSApplication.m +++ b/Source/NSApplication.m @@ -1446,11 +1446,11 @@ See -runModalForWindow: if ([modalDelegate respondsToSelector: didEndSelector]) { - void (*didEnd)(id, SEL, int, void*); + void (*didEnd)(id, SEL, id, int, void*); - didEnd = (void (*)(id, SEL, int, void*))[modalDelegate methodForSelector: + didEnd = (void (*)(id, SEL, id, int, void*))[modalDelegate methodForSelector: didEndSelector]; - didEnd(modalDelegate, didEndSelector, ret, contextInfo); + didEnd(modalDelegate, didEndSelector, sheet, ret, contextInfo); } } diff --git a/Source/NSBezierPath.m b/Source/NSBezierPath.m index a95f5b088..a5b8b390b 100644 --- a/Source/NSBezierPath.m +++ b/Source/NSBezierPath.m @@ -1211,7 +1211,7 @@ int contribution(NSPoint point, float dir, NSPoint start, NSPoint end, BOOL *hit NSPoint first_p, last_p; int count = [self elementCount]; BOOL first = YES; - float dir = 2 * PI * random() / RAND_MAX; + float dir = 2 * PI * rand() / RAND_MAX; BOOL hit; for(i = 0; i < count; i++) diff --git a/Source/NSMenu.m b/Source/NSMenu.m index c71e53907..6004eeab7 100644 --- a/Source/NSMenu.m +++ b/Source/NSMenu.m @@ -783,7 +783,14 @@ static NSNotificationCenter *nc; if (validator == nil) { - shouldBeEnabled = NO; + if ((action == NULL) && (_popUpButtonCell != nil)) + { + shouldBeEnabled = YES; + } + else + { + shouldBeEnabled = NO; + } } else if ([validator respondsToSelector: @selector(validateMenuItem:)]) diff --git a/Source/NSStringDrawing.m b/Source/NSStringDrawing.m index 8f93d8252..667a39f26 100644 --- a/Source/NSStringDrawing.m +++ b/Source/NSStringDrawing.m @@ -171,7 +171,7 @@ static int cache_match(int hasSize, NSSize size, int useScreenFonts, int *matche By starting at a random index, we avoid this kind of problem. */ - j = random() % NUM_CACHE_ENTRIES; + j = rand() % NUM_CACHE_ENTRIES; for (i = 0; i < NUM_CACHE_ENTRIES; i++, j++) { if (j == NUM_CACHE_ENTRIES)