if (sk == nil)
return;
+ if ([sk rangeOfString:@"."].length > 0)
+ sk = [sk stringByReplacingString:@"." withString:@"_"];
+
if (![sk isEqualToString:sortedKey])
sortDir = 0;
else if ( [_ctx objectForKey:WETableView_ISDESCENDING] == nil ||
if (icon == nil)
return;
#endif
-
+
// append something like that: sort.name.down
[_ctx appendElementIDComponent:@"sort"];
[_ctx appendElementIDComponent:sk]; // remember sortKey
[self->template takeValuesFromRequest:_req inContext:_ctx];
}
-- (id)invokeActionForRequest:(WORequest *)_request inContext:(WOContext *)_ctx {
+- (id)invokeActionForRequest:(WORequest *)_rq inContext:(WOContext *)_ctx {
WOComponent *cmp = nil;
NSString *k, *tmp;
BOOL doNegate;
cmp = [_ctx component];
k = [self->sortKey stringValueInComponent:cmp];
if (!([[_ctx currentElementID] isEqual:@"sort"] && k != nil))
- return [self->template invokeActionForRequest:_request inContext:_ctx];
-
+ return [self->template invokeActionForRequest:_rq inContext:_ctx];
+
[_ctx consumeElementID]; // consume "sort"
[_ctx appendElementIDComponent:@"sort"]; // append "sort"
+ if ([k rangeOfString:@"."].length > 0)
+ k = [k stringByReplacingString:@"." withString:@"_"];
+
tmp = [_ctx currentElementID];
+
if (!(tmp != nil && [tmp isEqualToString:k])) {
[_ctx deleteLastElementIDComponent]; // 'sort'
return nil;
self->title = WOExtGetProperty(_config, @"title");
self->align = WOExtGetProperty(_config, @"align");
self->valign = WOExtGetProperty(_config, @"valign");
- if (self->valign == nil) {
- self->valign = [WOAssociation associationWithValue:@"TOP"];
- RETAIN(self->valign);
- }
+ if (self->valign == nil)
+ self->valign = [[WOAssociation associationWithValue:@"TOP"] retain];
}
return self;
}
/* cluster */
if (([_config objectForKey:@"string"] != nil) ||
([_config objectForKey:@"value"] != nil)) {
- RELEASE(self);
+ [self release];
return [[_WEComplexTableData alloc] _initWithName:_name
associations:_config
template:_c];
}
- else
- return [self _initWithName:_name associations:_config template:_c];
+
+ return [self _initWithName:_name associations:_config template:_c];
}
- (void)dealloc {
- RELEASE(self->title);
- RELEASE(self->isGroup);
- RELEASE(self->align);
- RELEASE(self->valign);
+ [self->title release];
+ [self->isGroup release];
+ [self->align release];
+ [self->valign release];
[super dealloc];
}
key = [self->sortKey valueInComponent:cmp];
sortedKey = [_ctx objectForKey:WETableView_SORTEDKEY];
-
+
if (infos == nil) {
- infos = [NSMutableArray array];
+ infos = [NSMutableArray arrayWithCapacity:4];
[_ctx setObject:infos forKey:WETableView_INFOS];
}
- info = [[WETableViewInfo allocWithZone:[self zone]] init];
+ info = [[WETableViewInfo alloc] init];
info->rowSpan = 1;
info->isGroup = [self->isGroup boolValueInComponent:cmp];
info->isSorted = (key != nil && sortedKey != nil && [key isEqual:sortedKey]);
[infos addObject:info];
- AUTORELEASE(info);
+ [info release]; info = nil;
}
- (void)_appendHeader:(WOResponse *)_response inContext:(WOContext *)_ctx {
if (self->formatter != nil) num++;
if (self->numberformat != nil) num++;
if (self->dateformat != nil) num++;
- if (num > 1)
- NSLog(@"WARNING: more than one formats specified in element %@", self);
+ if (num > 1) {
+ [self warnWithFormat:
+ @"more than one formats specified in element: %@", self];
+ }
}
}
return self;