mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-24 06:28:54 +00:00
Add/Remove descriptors when appropriate
This commit is contained in:
parent
1f04167c7d
commit
369e45ebe2
1 changed files with 13 additions and 0 deletions
|
@ -601,22 +601,35 @@ static NSLock *_fontCollectionLock = nil;
|
|||
|
||||
- (void) setExclusionDescriptors: (NSArray *)exclusionDescriptors
|
||||
{
|
||||
NSMutableArray *qd = [[self queryDescriptors] mutableCopy];
|
||||
|
||||
[qd removeObjectsInArray: [self exclusionDescriptors]];
|
||||
[self setQueryDescriptors: [NSArray arrayWithArray: qd]];
|
||||
[_fontCollectionDictionary setObject: [exclusionDescriptors mutableCopy]
|
||||
forKey: @"NSFontExclusionDescriptorAttributes"];
|
||||
|
||||
}
|
||||
|
||||
- (void) addQueryForDescriptors: (NSArray *)descriptors
|
||||
{
|
||||
NSMutableArray *arr = [[self queryDescriptors] mutableCopy];
|
||||
NSMutableArray *ed = [[self exclusionDescriptors] mutableCopy];
|
||||
|
||||
[ed removeObjectsInArray: arr];
|
||||
[arr addObjectsFromArray: descriptors];
|
||||
[self setQueryDescriptors: arr];
|
||||
[self setExclusionDescriptors: [NSArray arrayWithArray: ed]];
|
||||
}
|
||||
|
||||
- (void) removeQueryForDescriptors: (NSArray *)descriptors
|
||||
{
|
||||
NSMutableArray *arr = [[self queryDescriptors] mutableCopy];
|
||||
NSMutableArray *ed = [[self exclusionDescriptors] mutableCopy];
|
||||
|
||||
[ed addObjectsFromArray: descriptors];
|
||||
[arr removeObjectsInArray: descriptors];
|
||||
[self setQueryDescriptors: arr];
|
||||
[self setExclusionDescriptors: [NSArray arrayWithArray: ed]];
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
Loading…
Reference in a new issue