diff --git a/ChangeLog b/ChangeLog index bc4066784..1639b8290 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-09-09 Fred Kiefer + + * Source/NSView.m (-_lockFocusInContext:inRect:): Correct the + handling of renewgstate. + * Source/GSFontInfo.m (GSFontEnumerator-availableFontDescriptors): + Retain the generated list of font descriptors. + 2009-09-07 Fred Kiefer * Headers/AppKit/NSMenuItem.h: Let the protocol NSMenuItem diff --git a/Source/GSFontInfo.m b/Source/GSFontInfo.m index 54622367a..c0bb3b8f4 100644 --- a/Source/GSFontInfo.m +++ b/Source/GSFontInfo.m @@ -111,7 +111,7 @@ static GSFontEnumerator *sharedEnumerator = nil; NSEnumerator *keyEnumerator; NSString *family; - fontDescriptors = [NSMutableArray array]; + fontDescriptors = [[NSMutableArray alloc] init]; keyEnumerator = [allFontFamilies keyEnumerator]; while ((family = [keyEnumerator nextObject]) != nil) { diff --git a/Source/NSView.m b/Source/NSView.m index 12045b158..ad548a2c8 100644 --- a/Source/NSView.m +++ b/Source/NSView.m @@ -1989,14 +1989,9 @@ convert_rect_using_matrices(NSRect aRect, NSAffineTransform *matrix1, } else { - if (_gstate) + if (_gstate && !_renew_gstate) { DPSsetgstate(ctxt, _gstate); - if (_renew_gstate) - { - [self setUpGState]; - _renew_gstate = NO; - } DPSgsave(ctxt); } else @@ -2011,13 +2006,19 @@ convert_rect_using_matrices(NSRect aRect, NSAffineTransform *matrix1, _renew_gstate = NO; if (_allocate_gstate) { - _gstate = GSDefineGState(ctxt); + if (_gstate) + { + GSReplaceGState(ctxt, _gstate); + } + else + { + _gstate = GSDefineGState(ctxt); + } /* Balance the previous gsave and install our own gstate */ DPSgrestore(ctxt); DPSsetgstate(ctxt, _gstate); DPSgsave(ctxt); } - } }