mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-31 19:10:48 +00:00
Minor retain/release fix
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@6637 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
620dfcfa5b
commit
ef98c0cf61
2 changed files with 46 additions and 29 deletions
|
@ -1,3 +1,8 @@
|
|||
2000-06-03 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Source/NSAttributedString.m: ([-setAlignment:range:]) retain/release
|
||||
problem fixed.
|
||||
|
||||
Thu Jun 1 21:50:34 2000 Nicola Pero <nicola@brainstorm.co.uk>
|
||||
|
||||
* Source/NSScrollView.m ([NSScrollView -tile]): Fixed position of
|
||||
|
|
|
@ -177,7 +177,7 @@ paraBreakCSet()
|
|||
atIndex: range.location
|
||||
effectiveRange: &range];
|
||||
|
||||
if (style)
|
||||
if (style != nil)
|
||||
{
|
||||
return [NSDictionary dictionaryWithObject: style
|
||||
forKey: NSParagraphStyleAttributeName];
|
||||
|
@ -550,7 +550,6 @@ documentAttributes: (NSDictionary**)dict
|
|||
{
|
||||
id value;
|
||||
unsigned loc = range.location;
|
||||
NSRange effRange;
|
||||
|
||||
if (range.location < 0 || NSMaxRange(range) > [self length])
|
||||
{
|
||||
|
@ -560,20 +559,34 @@ documentAttributes: (NSDictionary**)dict
|
|||
|
||||
while (loc < NSMaxRange(range))
|
||||
{
|
||||
BOOL copiedStyle = NO;
|
||||
NSRange effRange;
|
||||
NSRange newRange;
|
||||
|
||||
value = [self attribute: NSParagraphStyleAttributeName
|
||||
atIndex: loc
|
||||
effectiveRange: &effRange];
|
||||
newRange = NSIntersectionRange(effRange, range);
|
||||
|
||||
if (value == nil)
|
||||
{
|
||||
value = [NSMutableParagraphStyle defaultParagraphStyle];
|
||||
}
|
||||
else
|
||||
{
|
||||
value = [value mutableCopy];
|
||||
copiedStyle = YES;
|
||||
}
|
||||
|
||||
[value setAlignment: alignment];
|
||||
|
||||
[self addAttribute: NSParagraphStyleAttributeName
|
||||
value: value
|
||||
range: NSIntersectionRange(effRange, range)];
|
||||
range: newRange];
|
||||
if (copiedStyle == YES)
|
||||
{
|
||||
RELEASE(value);
|
||||
}
|
||||
loc = NSMaxRange(effRange);
|
||||
}
|
||||
}
|
||||
|
@ -592,7 +605,6 @@ documentAttributes: (NSDictionary**)dict
|
|||
[NSException raise: NSRangeException
|
||||
format: @"RangeError in method -fixFontAttributeInRange:"];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
- (void) fixParagraphStyleAttributeInRange: (NSRange)range
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue