+2005-04-24 Helge Hess <helge.hess@opengroupware.org>
+
+ * fixed gcc 4.0 warnings (v4.5.72)
+
2005-04-12 Helge Hess <helge.hess@opengroupware.org>
* v4.5.71
# version file
-SUBMINOR_VERSION:=71
+SUBMINOR_VERSION:=72
# v4.5.65 requires libNGObjWeb v4.5.106
return self;
}
-#if !LIB_FOUNDATION_BOEHM_GC
- (void)dealloc {
- RELEASE(self->template);
- RELEASE(self->negate);
- RELEASE(self->contextKey);
- RELEASE(self->didMatch);
+ [self->template release];
+ [self->negate release];
+ [self->contextKey release];
+ [self->didMatch release];
[super dealloc];
}
-#endif
-// accessors
+/* accessors */
-- (WOElement *)template {
+- (id)template {
return self->template;
}
return nil;
}
-// state
+/* state */
static inline BOOL _doShow(WEContextConditional *self, WOContext *_ctx) {
BOOL doShow = NO;
return 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];
}
}
-- (id)invokeActionForRequest:(WORequest *)_request inContext:(WOContext *)_ctx {
+- (id)invokeActionForRequest:(WORequest *)_rq inContext:(WOContext *)_ctx {
NSString *state;
+ id result;
- state = [[_ctx currentElementID] stringValue];
+ if ((state = [[_ctx currentElementID] stringValue]) == nil)
+ return nil;
- if (state) {
- [_ctx consumeElementID]; // consume state-id (on or off)
+ [_ctx consumeElementID]; // consume state-id (on or off)
- if ([state isEqualToString:@"1"]) {
- id result;
+ if (![state isEqualToString:@"1"])
+ return nil;
- [_ctx appendElementIDComponent:state];
- result = [self->template invokeActionForRequest:_request inContext:_ctx];
- [_ctx deleteLastElementIDComponent];
-
- return result;
- }
- }
- return nil;
+ [_ctx appendElementIDComponent:state];
+ result = [self->template invokeActionForRequest:_rq inContext:_ctx];
+ [_ctx deleteLastElementIDComponent];
+ return result;
}
+/* generate response */
+
- (void)appendToResponse:(WOResponse *)_response inContext:(WOContext *)_ctx {
if (_doShow(self, _ctx)) {
[_ctx appendElementIDComponent:@"1"];
/* accessors */
-- (WOElement *)template {
+- (id)template {
return self->template;
}
@end /* WEDragContainer */
+
@implementation WEDragScript
+ (void)appendDragScriptToResponse:(WOResponse *)_response
}
}
-// --- accessors ---
+/* accessors */
-- (WOElement *)template {
+- (id)template {
return self->template;
}
@end /* WEDropContainer */
+
@implementation WEDropScript
+ (void)appendDropScriptToResponse:(WOResponse *)_response
- (NSDictionary *)monthOverviewContext {
return [self objectForKey:@"WEMonthOverview"];
}
-- (NSArray *)monthOverviewQueryObjects {
+- (NSMutableArray *)monthOverviewQueryObjects {
return [[self monthOverviewContext] valueForKey:@"query"];
}
case 10: return @"10";
// TODO: find useful count!
default: {
- unsigned char buf[32];
+ char buf[32];
sprintf(buf, "%i", i);
return [[StrClass alloc] initWithCString:buf];
}
}
-- (void)takeContentValues:(WORequest *)_req
- inContext:(WOContext *)_ctx
- index:(int)_idx
+- (void)takeContentValues:(WORequest *)_req inContext:(WOContext *)_ctx
+ index:(int)_idx
{
WOComponent *comp;
NSString *s;
NSArray *array;
- int i, idx, cnt, count;
+ int i, cnt, count;
comp = [_ctx component];
array = [self->list valueInComponent:comp];
count = [array count];
[_ctx appendElementIDComponent:@"c"]; // append content mode
-
- cnt = [self->matrix[_idx] count];
- for (i=0; i<cnt; i++) {
+
+ for (i = 0, cnt = [self->matrix[_idx] count]; i < cnt; i++) {
+ int idx;
+
idx = [[self->matrix[_idx] objectAtIndex:i] intValue];
- if (self->index)
+ if (self->index != nil)
[self->index setUnsignedIntValue:idx inComponent:comp];
- if (self->item)
+ if (self->item != nil)
[self->item setValue:[array objectAtIndex:idx] inComponent:comp];
- s = (self->identifier)
+ s = (self->identifier != nil)
? [[self->identifier stringValueInComponent:comp] retain]
: retStrForInt(idx);
NSString *week;
int i, j;
unsigned int weekOfYear;
- unsigned char buf[32];
+ char buf[32];
[self _calcMatrixInContext:_ctx];
@end /* WEMonthOverview */
+
@implementation WEMonthLabel
- (id)initWithName:(NSString *)_name
[super dealloc];
}
+/* handle requests */
+
- (void)takeValuesFromRequest:(WORequest *)_req inContext:(WOContext *)_ctx {
NSDictionary *monthViewContextDict;
NSString *orient;
isEdge = ([orient rangeOfString:@"/"].length > 0);
monthViewContextDict = [_ctx monthOverviewContext];
- if ((tmp = [monthViewContextDict objectForKey:orient]) != nil) {
- if (!isEdge) {
- [_ctx appendElementIDComponent:orient];
- [self->template takeValuesFromRequest:_req inContext:_ctx];
- [_ctx deleteLastElementIDComponent];
- }
- else {
- [self->template takeValuesFromRequest:_req inContext:_ctx];
- }
+ if ((tmp = [monthViewContextDict objectForKey:orient]) == nil)
+ return;
+
+ if (!isEdge) {
+ [_ctx appendElementIDComponent:orient];
+ [self->template takeValuesFromRequest:_req inContext:_ctx];
+ [_ctx deleteLastElementIDComponent];
}
+ else
+ [self->template takeValuesFromRequest:_req inContext:_ctx];
}
- (id)invokeActionForRequest:(WORequest *)_req inContext:(WOContext *)_ctx {
return result;
}
+/* generate response */
+
- (void)appendToResponse:(WOResponse *)_response inContext:(WOContext *)_ctx {
NSDictionary *monthViewContextDict;
NSMutableArray *queryContext;
@end /* WEMonthLabel */
+
@implementation WEMonthTitle
- (id)initWithName:(NSString *)_name
@end /* WEMonthTitle */
+
@interface WEMonthOverviewInfoMode : WEContextConditional
@end
@end /* WEMonthOverviewInfoMode */
+
@interface WEMonthOverviewContentMode : WEContextConditional
@end
NSString *href;
href = [_ctx componentActionURL];
- [_response appendContentCString:"<a href=\""];
+ [_response appendContentCString:(unsigned char *)"<a href=\""];
[_response appendContentString:href];
[_response appendContentCharacter:'"'];
[_response appendContentCharacter:'>'];
[self->template appendToResponse:_response inContext:_ctx];
- [_response appendContentCString:"</a>"];
+ [_response appendContentCString:(unsigned char *)"</a>"];
}
@end /* WEPageLink */
cmp = [_ctx component];
+ // TODO: use CSS
tC = [self->fontColor stringValueInComponent:cmp];
tF = [self->fontFace stringValueInComponent:cmp];
tS = [self->fontSize stringValueInComponent:cmp];
for (i = 0, count = [keys count]; i < count; i++) {
WEPageItemInfo *info;
- info = [keys objectAtIndex:i];
+ info = [keys objectAtIndex:i];
+ // TODO: use CSS
if ([info->key isEqualToString:activeKey]) {
[_response appendContentString:@"<b>"];
[_response appendContentString:info->title];
break;
}
}
- sprintf(buf, " <small>(%d/%d)</small>", (i + 1), count);
+ // TODO: use CSS
+ sprintf((char *)buf, " <small>(%d/%d)</small>", (i + 1), count);
[_response appendContentCString:buf];
if (hasFont)
if ((k = [self->key stringValueInComponent:[_ctx component]]) == nil) {
/* auto-assign a key */
- unsigned char kb[16];
+ char kb[16];
sprintf(kb, "%d", [keys count]);
k = [NSString stringWithCString:kb];
}
/* accessors */
-- (WOElement *)template {
+- (id)template {
return self->template;
}
id object;
stripe = [[WETableCalcMatrixStripe alloc]
- initWithSize:self->height
- matrix:self
- delegate:self->delegate];
+ initWithSize:self->height
+ matrix:self
+ delegate:self->delegate];
+ stripe = [stripe autorelease];
objects = [[self objectsInColumn:_x] objectEnumerator];
- while ((object = [objects nextObject])) {
+ while ((object = [objects nextObject]) != nil) {
WETableCalcMatrixPositionArray *pos;
unsigned *indices;
unsigned idxCount;
[stripe addObject:object atPositions:indices count:idxCount];
}
- AUTORELEASE(stripe);
return [stripe threadSpans];
}
-- (id)spansOfRow:(unsigned)_y {
+- (NSArray *)spansOfRow:(unsigned)_y {
WETableCalcMatrixStripe *stripe;
NSEnumerator *objects;
id object;
stripe = [[WETableCalcMatrixStripe alloc]
- initWithSize:self->width
- matrix:self
- delegate:self->delegate];
+ initWithSize:self->width
+ matrix:self
+ delegate:self->delegate];
+ stripe = [stripe autorelease];
objects = [[self objectsInRow:_y] objectEnumerator];
while ((object = [objects nextObject])) {
[stripe addObject:object atPositions:indices count:idxCount];
}
- AUTORELEASE(stripe);
return [stripe threadSpans];
}
isCollapsed = ![self->showGroup boolValueInComponent:comp];
[_response appendContentString:@"<tr><td colspan=\""];
- sprintf(buf, "%d", colspan);
+ sprintf((char *)buf, "%d", colspan);
[_response appendContentCString:buf];
[_response appendContentCharacter:'"'];
}
- (NSString *)colspanAsString {
- unsigned char buf[8];
+ char buf[8];
sprintf(buf, "%d", self->colspan);
return [NSString stringWithCString:buf];
}