mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-06-01 22:41:56 +00:00
Made setAlignment:range: save against missing paragraph style
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@6702 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
204663c900
commit
77f49737e3
1 changed files with 10 additions and 5 deletions
|
@ -2883,7 +2883,8 @@ scanRange(NSScanner *scanner, NSCharacterSet* aSet)
|
||||||
- (void) setAlignment: (NSTextAlignment)alignment
|
- (void) setAlignment: (NSTextAlignment)alignment
|
||||||
range: (NSRange)aRange
|
range: (NSRange)aRange
|
||||||
{
|
{
|
||||||
NSMutableParagraphStyle *style;
|
NSParagraphStyle *style;
|
||||||
|
NSMutableParagraphStyle *mstyle;
|
||||||
|
|
||||||
if (aRange.location == NSNotFound)
|
if (aRange.location == NSNotFound)
|
||||||
return;
|
return;
|
||||||
|
@ -2898,11 +2899,15 @@ scanRange(NSScanner *scanner, NSCharacterSet* aSet)
|
||||||
[self didChangeText];
|
[self didChangeText];
|
||||||
|
|
||||||
// Set the typing attributes
|
// Set the typing attributes
|
||||||
style = [[_typingAttributes objectForKey: NSParagraphStyleAttributeName]
|
style = [_typingAttributes objectForKey: NSParagraphStyleAttributeName];
|
||||||
mutableCopy];
|
if (style == nil)
|
||||||
[style setAlignment: alignment];
|
style = [NSParagraphStyle defaultParagraphStyle];
|
||||||
|
|
||||||
|
mstyle = [style mutableCopy];
|
||||||
|
|
||||||
|
[mstyle setAlignment: alignment];
|
||||||
// FIXME: Should use setTypingAttributes
|
// FIXME: Should use setTypingAttributes
|
||||||
[_typingAttributes setObject: style forKey: NSParagraphStyleAttributeName];
|
[_typingAttributes setObject: mstyle forKey: NSParagraphStyleAttributeName];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSString*) preferredPasteboardTypeFromArray: (NSArray*)availableTypes
|
- (NSString*) preferredPasteboardTypeFromArray: (NSArray*)availableTypes
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue