From 71311dac3da613bb8d6450d50700d4d0c8fb0b90 Mon Sep 17 00:00:00 2001 From: helge Date: Tue, 19 Jul 2005 10:06:33 +0000 Subject: [PATCH] minor code cleanups git-svn-id: http://svn.opengroupware.org/SOPE/trunk@913 e4a50df8-12e2-0310-a44c-efbce7f8a7e3 --- sope-appserver/WOExtensions/ChangeLog | 4 +++ sope-appserver/WOExtensions/Version | 2 +- .../WOExtensions/WOKeyValueConditional.m | 32 ++++++++----------- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/sope-appserver/WOExtensions/ChangeLog b/sope-appserver/WOExtensions/ChangeLog index 93da8057..959a3df4 100644 --- a/sope-appserver/WOExtensions/ChangeLog +++ b/sope-appserver/WOExtensions/ChangeLog @@ -1,3 +1,7 @@ +2005-07-19 Helge Hess + + * WOKeyValueConditional.m: minor code cleanups (v4.5.26) + 2005-07-11 Marcus Mueller * WOExtensions-Info.plist: corrected bundle identifier diff --git a/sope-appserver/WOExtensions/Version b/sope-appserver/WOExtensions/Version index a80a0e23..b7aa6f04 100644 --- a/sope-appserver/WOExtensions/Version +++ b/sope-appserver/WOExtensions/Version @@ -1,6 +1,6 @@ # Version file -SUBMINOR_VERSION:=25 +SUBMINOR_VERSION:=26 # v4.5.23 requires libNGObjWeb v4.5.145 # v4.5.22 requires libNGObjWeb v4.5.106 diff --git a/sope-appserver/WOExtensions/WOKeyValueConditional.m b/sope-appserver/WOExtensions/WOKeyValueConditional.m index b5c64b83..60ddbf03 100644 --- a/sope-appserver/WOExtensions/WOKeyValueConditional.m +++ b/sope-appserver/WOExtensions/WOKeyValueConditional.m @@ -49,27 +49,25 @@ self->key = WOExtGetProperty(_config, @"key"); self->value = WOExtGetProperty(_config, @"value"); self->negate = WOExtGetProperty(_config, @"negate"); - self->template = RETAIN(_c); + self->template = [_c retain]; } return self; } -#if !LIB_FOUNDATION_BOEHM_GC - (void)dealloc { - RELEASE(self->template); - RELEASE(self->value); - RELEASE(self->key); + [self->template release]; + [self->value release]; + [self->key release]; [super dealloc]; } -#endif -// accessors +/* accessors */ - (WOElement *)template { return self->template; } -// state +/* state */ static inline BOOL _doShow(WOKeyValueConditional *self, WOContext *_ctx) { WOComponent *c = [_ctx component]; @@ -87,14 +85,12 @@ static inline BOOL _doShow(WOKeyValueConditional *self, WOContext *_ctx) { return doNegate ? !doShow : doShow; } -// ******************** responder ******************** +/* handling requests */ -- (void)takeValuesFromRequest:(WORequest *)_request - inContext:(WOContext *)_ctx -{ +- (void)takeValuesFromRequest:(WORequest *)_rq inContext:(WOContext *)_ctx { if (_doShow(self, _ctx)) { [_ctx appendElementIDComponent:@"1"]; - [self->template takeValuesFromRequest:_request inContext:_ctx]; + [self->template takeValuesFromRequest:_rq inContext:_ctx]; [_ctx deleteLastElementIDComponent]; } #if 0 @@ -106,7 +102,7 @@ static inline BOOL _doShow(WOKeyValueConditional *self, WOContext *_ctx) { #endif } -- (id)invokeActionForRequest:(WORequest *)_request inContext:(WOContext *)_ctx { +- (id)invokeActionForRequest:(WORequest *)_rq inContext:(WOContext *)_ctx { NSString *state; state = [[_ctx currentElementID] stringValue]; @@ -118,7 +114,7 @@ static inline BOOL _doShow(WOKeyValueConditional *self, WOContext *_ctx) { id result; [_ctx appendElementIDComponent:state]; - result = [self->template invokeActionForRequest:_request inContext:_ctx]; + result = [self->template invokeActionForRequest:_rq inContext:_ctx]; [_ctx deleteLastElementIDComponent]; return result; @@ -138,14 +134,14 @@ static inline BOOL _doShow(WOKeyValueConditional *self, WOContext *_ctx) { /* description */ - (NSString *)associationDescription { - NSMutableString *str = [[NSMutableString alloc] init]; + NSMutableString *str; + str = [NSMutableString stringWithCapacity:64]; if (self->key) [str appendFormat:@" key=%@", self->key]; if (self->value) [str appendFormat:@" value=%@", self->value]; if (self->negate) [str appendFormat:@" negate=%@", self->negate]; if (self->template) [str appendFormat:@" template=%@", self->template]; - - return AUTORELEASE(str); + return str; } @end /* WOKeyValueConditional */ -- 2.39.5