From f2084de13246c3d2ec2e392e1cfce189c3ccea08 Mon Sep 17 00:00:00 2001 From: helge Date: Mon, 24 Jul 2006 18:19:48 +0000 Subject: [PATCH] minor code cleanups git-svn-id: http://svn.opengroupware.org/SOPE/trunk@1326 e4a50df8-12e2-0310-a44c-efbce7f8a7e3 --- sope-appserver/WEExtensions/ChangeLog | 4 ++++ sope-appserver/WEExtensions/Version | 2 +- sope-appserver/WEExtensions/WEWeekOverview.m | 16 ++++++++++------ 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/sope-appserver/WEExtensions/ChangeLog b/sope-appserver/WEExtensions/ChangeLog index fd094e28..04bed36a 100644 --- a/sope-appserver/WEExtensions/ChangeLog +++ b/sope-appserver/WEExtensions/ChangeLog @@ -1,3 +1,7 @@ +2006-07-24 Helge Hess + + * WEWeekOverview.m: use -warnWithFormat:, minor code cleanups (v4.5.88) + 2006-07-05 Helge Hess * WEResourceManager.m: added FHS_INSTALL_ROOT to lookup path (v4.5.87) diff --git a/sope-appserver/WEExtensions/Version b/sope-appserver/WEExtensions/Version index 7a6e3ea8..b015e49b 100644 --- a/sope-appserver/WEExtensions/Version +++ b/sope-appserver/WEExtensions/Version @@ -1,6 +1,6 @@ # version file -SUBMINOR_VERSION:=87 +SUBMINOR_VERSION:=88 # v4.5.76 requires libNGObjWeb v4.5.176 # v4.5.75 requires libNGObjWeb v4.5.174 diff --git a/sope-appserver/WEExtensions/WEWeekOverview.m b/sope-appserver/WEExtensions/WEWeekOverview.m index dcf38366..32e7dbcd 100644 --- a/sope-appserver/WEExtensions/WEWeekOverview.m +++ b/sope-appserver/WEExtensions/WEWeekOverview.m @@ -378,6 +378,7 @@ _applyIndex(WEWeekOverview *self, WOComponent *comp, unsigned _idx) } - (void)_calcMatrixInContext:(WOContext *)_ctx { + // THREAD: uses temporary ivars WOComponent *comp; NSCalendarDate *startWeek; NSCalendarDate *endWeek; @@ -430,11 +431,12 @@ _applyIndex(WEWeekOverview *self, WOComponent *comp, unsigned _idx) idx = floor((diff / SecondsPerWeek) * 14); - if ((self->item) && (self->isInfoItem)) { + if ((self->item != nil) && (self->isInfoItem)) { [self->item setValue:app inComponent:comp]; isInfo = [[self->isInfoItem valueInComponent:comp] boolValue]; } - else isInfo = NO; + else + isInfo = NO; if ((0 <= idx) && (idx < 14)) { if (isInfo) { @@ -960,6 +962,7 @@ _applyIndex(WEWeekOverview *self, WOComponent *comp, unsigned _idx) /* P.M.Infos */ [self takeValues:_req mode:WEWeekOverview_PMInfoMode modeId:@"p" ctx:_ctx]; + // THREAD: uses temporary ivars [self _calcMatrixInContext:_ctx]; [_ctx setObject:@"YES" forKey:WEWeekOverview_ContentMode]; @@ -1120,7 +1123,7 @@ _applyIndex(WEWeekOverview *self, WOComponent *comp, unsigned _idx) headers = [self->headerRows valueInComponent:comp]; idx = [sectionId intValue]; if (idx >= (int)[headers count]) { - NSLog(@"WARNING! WEWeekOverview: wrong headerrow index"); + [self warnWithFormat:@"WEWeekOverview: wrong headerrow index"]; } else { result = [self invokeActionForHeader:_req @@ -1135,7 +1138,7 @@ _applyIndex(WEWeekOverview *self, WOComponent *comp, unsigned _idx) footers = [self->footerRows valueInComponent:comp]; idx = [sectionId intValue]; if (idx >= (int)[footers count]) { - NSLog(@"WARNING! WEWeekOverview: wrong footerrow index"); + [self warnWithFormat:@"WEWeekOverview: wrong footerrow index"]; } else { result = [self invokeActionForFooter:_req @@ -1175,7 +1178,8 @@ _applyIndex(WEWeekOverview *self, WOComponent *comp, unsigned _idx) showWeekend = (self->hideWeekend != nil) ? [self->hideWeekend boolValueInComponent:comp] ? NO : YES : YES; - + + // TODO: use CSS over here [_response appendContentString: @""]; - + /* AM weekdays content (this is count=10 because we slot 0=AM/1=PM, etc) */ for (i = 0; i < 10; i = i + 2) { if ([self->dayIndex isValueSettable]) -- 2.39.5