From 25d72032f5f6296c69a5e44fb41ee9bc7942e8ca Mon Sep 17 00:00:00 2001 From: Bibiko Date: Mon, 4 Jan 2010 09:29:38 +0000 Subject: =?UTF-8?q?=E2=80=A2=20ContentFilterManager=20-=20reimplemented=20?= =?UTF-8?q?the=20display=20of=20the=20conjunction=20label=20for=20two=20ar?= =?UTF-8?q?guments=20-=20fixed=20bug=20while=20parsing=20and=20storing=20t?= =?UTF-8?q?he=20number=20of=20arguments=20of=20each=20filter=20definition?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Source/SPContentFilterManager.m | 2 +- Source/TableContent.m | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'Source') diff --git a/Source/SPContentFilterManager.m b/Source/SPContentFilterManager.m index 540000ab..35896fcc 100644 --- a/Source/SPContentFilterManager.m +++ b/Source/SPContentFilterManager.m @@ -182,7 +182,7 @@ NSMutableDictionary *d = [[NSMutableDictionary alloc] init]; [d setDictionary:[contentFilters objectAtIndex:i]]; NSMutableArray *conjLabel = [[NSMutableArray alloc] init]; - numOfArgs = [[[contentFilterTextView string] componentsMatchedByRegex:@"(? 1) { if([d objectForKey:@"ConjunctionLabel"]) { [conjLabel addObject:[d objectForKey:@"ConjunctionLabel"]]; diff --git a/Source/TableContent.m b/Source/TableContent.m index c4f60029..6b8ecf0e 100644 --- a/Source/TableContent.m +++ b/Source/TableContent.m @@ -1061,11 +1061,14 @@ NSDictionary *filter = [[contentFilters objectForKey:compareType] objectAtIndex:lastSelectedContentFilterIndex]; NSUInteger numOfArgs = [[filter objectForKey:@"NumberOfArguments"] intValue]; - if ([[filter objectForKey:@"NumberOfArguments"] intValue] == 2) { + if (numOfArgs == 2) { [argumentField setHidden:YES]; - if(numOfArgs == 1) + if([filter objectForKey:@"ConjunctionLabels"] && [[filter objectForKey:@"ConjunctionLabels"] count] == 1) [betweenTextField setStringValue:[[filter objectForKey:@"ConjunctionLabels"] objectAtIndex:0]]; + else + [betweenTextField setStringValue:@""]; + [betweenTextField setHidden:NO]; [firstBetweenField setHidden:NO]; [secondBetweenField setHidden:NO]; -- cgit v1.2.3