[OGo-GNUstep-Port] skyrix-sope rangeOfString changes

Filip Van Raemdonck gnustep-port@opengroupware.org
Fri, 25 Jul 2003 12:44:34 +0200


--VbJkn9YxBvnuCH5J
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Hi,

Attached is a patch which converts all indexOfString calls in skyrix-sope to
rangeOfString, as well as minimal other fixes (mostly typecasts, and a few
ifdef GNUSTEP_BASE_LIBRARY things) in files touched by these rangeOfString
changes.

Fairly straightforward I'd say; please apply.


Regards,

Filip

-- 
> Too bad that John Romero probably doesn't want to leave Texas.
Be careful what you wish for.
When I lived there, I said that about a certain State Governor. See what
happened? =)
	-- some blog comment

--VbJkn9YxBvnuCH5J
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=diff-skyrix-sope-range

diff -ru skyrix-sope-old/NGObjDOM/common.h skyrix-sope-new/NGObjDOM/common.h
--- skyrix-sope-old/NGObjDOM/common.h	2003-07-17 18:41:40.000000000 +0200
+++ skyrix-sope-new/NGObjDOM/common.h	2003-07-25 11:18:51.000000000 +0200
@@ -26,8 +26,10 @@
 #import <Foundation/Foundation.h>
 
 #if !LIB_FOUNDATION_LIBRARY
+#  ifndef GNUSTEP_BASE_LIBRARY
 #  include <FoundationExt/NSObjectMacros.h>
 #  include <FoundationExt/MissingMethods.h>
+#  endif
 #endif
 
 #include <NGExtensions/NGExtensions.h>
@@ -189,7 +191,7 @@
                          inFramework:nil
                          languages:languages
                          request:[_ctx request]];
-  if ([uri indexOfString:@"/missingresource?"] != NSNotFound)
+  if ([uri rangeOfString:@"/missingresource?"].length > 0)
     uri = nil;
   
   return uri;
diff -ru skyrix-sope-old/NGObjWeb/NGHttp/NGHttpHeaderFields.m skyrix-sope-new/NGObjWeb/NGHttp/NGHttpHeaderFields.m
--- skyrix-sope-old/NGObjWeb/NGHttp/NGHttpHeaderFields.m	2003-07-17 18:41:44.000000000 +0200
+++ skyrix-sope-new/NGObjWeb/NGHttp/NGHttpHeaderFields.m	2003-07-25 12:17:46.000000000 +0200
@@ -20,8 +20,8 @@
 */
 // $Id: NGHttpHeaderFields.m,v 1.2 2003/07/11 17:12:51 jan Exp $
 
-#import "common.h"
-#import "NGHttpHeaderFields.h"
+#include "common.h"
+#include "NGHttpHeaderFields.h"
 
 @implementation NGHttpHostHeaderField
 
@@ -375,20 +375,20 @@
   NSString *s;
   
   s = [_value lowercaseString];
-  
-  if ([s indexOfString:@"keep-alive"] != NSNotFound) {
+
+  if ([s rangeOfString:@"keep-alive"].length > 0) {
     if ((self = [super init])) {
       self->keepAlive = YES;
     }
     return self;
   }
-  else if ([s indexOfString:@"close"] != NSNotFound) {
+  else if ([s rangeOfString:@"close"].length > 0) {
     if ((self = [super init])) {
       self->close = YES;
     }
     return self;
   }
-  else if ([s indexOfString:@"te"] != NSNotFound) {
+  else if ([s rangeOfString:@"te"].length > 0) {
     if ((self = [super init])) {
       self->isTE = YES;
     }
@@ -453,17 +453,18 @@
 @implementation NGHttpCredentials
 
 + (id)credentialsWithString:(NSString *)_cred {
-  unsigned int idx;
+  NSRange rng;
   NSString *lscheme;
   NSData   *cred;
   
   if ([_cred length] == 0)
     return nil;
-  if ((idx = [_cred indexOfString:@" "]) == NSNotFound)
+  rng = [_cred rangeOfString:@" "];
+  if (rng.length <= 0)
     return nil;
-  
-  lscheme = [_cred substringToIndex:idx];
-  cred    = [[_cred substringFromIndex:(idx + 1)]
+
+  lscheme = [_cred substringToIndex:rng.location];
+  cred    = [[_cred substringFromIndex:(rng.location + 1)]
                     dataUsingEncoding:NSISOLatin1StringEncoding];
   
   return [self credentialsWithScheme:lscheme credentials:cred];
diff -ru skyrix-sope-old/NGObjWeb/NGXmlRpc/WODirectAction+XmlRpc.m skyrix-sope-new/NGObjWeb/NGXmlRpc/WODirectAction+XmlRpc.m
--- skyrix-sope-old/NGObjWeb/NGXmlRpc/WODirectAction+XmlRpc.m	2003-07-17 18:41:44.000000000 +0200
+++ skyrix-sope-new/NGObjWeb/NGXmlRpc/WODirectAction+XmlRpc.m	2003-07-25 11:53:26.000000000 +0200
@@ -101,14 +101,15 @@
   while ((sel = [sels nextObject])) {
     unsigned idx, len;
     NSString *actionName;
+    NSRange rng;
+
+    rng = [sel rangeOfString:@"Action"];
+    if (rng.length <= 0) continue;
 
-    idx = [sel indexOfString:@"Action"];
-    if (idx == NSNotFound) continue;
-    
     actionName = sel;
     
     /* ensure that only dots are following the 'Action' */
-    for (idx = (idx + 6), len = [sel length]; idx < len; idx++) {
+    for (idx = (rng.location + 6), len = [sel length]; idx < len; idx++) {
       unichar c = [sel characterAtIndex:idx];
       if (c != ':') {
         actionName = nil;
diff -ru skyrix-sope-old/NGObjWeb/NGXmlRpc/WODirectAction+XmlRpcIntrospection.m skyrix-sope-new/NGObjWeb/NGXmlRpc/WODirectAction+XmlRpcIntrospection.m
--- skyrix-sope-old/NGObjWeb/NGXmlRpc/WODirectAction+XmlRpcIntrospection.m	2003-07-17 18:41:45.000000000 +0200
+++ skyrix-sope-new/NGObjWeb/NGXmlRpc/WODirectAction+XmlRpcIntrospection.m	2003-07-25 11:55:20.000000000 +0200
@@ -128,19 +128,19 @@
   while ((sel = [sels nextObject])) {
     unsigned idx, len;
     NSString *actionName;
+    NSRange rng;
 
     if ([blacklist containsObject:sel])
       continue;
-      
-    idx = [sel indexOfString:@"Action"];
-    
-    if (idx == NSNotFound) continue;
-    
+
+    rng = [sel rangeOfString:@"Action"];
+    if (rng.length <= 0) continue;
+
     /* strip Action */
-    actionName = [sel substringToIndex:idx];
-    
+    actionName = [sel substringToIndex:rng.location];
+
     /* ensure that only dots are following the 'Action' */
-    for (idx = (idx + 6), len = [sel length]; idx < len; idx++) {
+    for (idx = (rng.location + 6), len = [sel length]; idx < len; idx++) {
       unichar c = [sel characterAtIndex:idx];
       if (c != ':') {
         actionName = nil;
diff -ru skyrix-sope-old/NGObjWeb/SoObjects/SoHTTPAuthenticator.m skyrix-sope-new/NGObjWeb/SoObjects/SoHTTPAuthenticator.m
--- skyrix-sope-old/NGObjWeb/SoObjects/SoHTTPAuthenticator.m	2003-07-17 18:41:45.000000000 +0200
+++ skyrix-sope-new/NGObjWeb/SoObjects/SoHTTPAuthenticator.m	2003-07-25 11:59:15.000000000 +0200
@@ -30,6 +30,8 @@
 #include <NGObjWeb/WOContext.h>
 #include "common.h"
 
+#include <NGExtensions/NSString+Ext.h>
+
 @implementation SoHTTPAuthenticator
 
 + (int)version {
@@ -39,7 +41,7 @@
 /* HTTP basic authentication */
 
 - (NSString *)authRealm {
-  return [[WOApplication application] name];
+  return [(WOApplication *)[WOApplication application] name];
 }
 
 /* check for roles */
@@ -50,7 +52,7 @@
 }
 
 - (NSArray *)parseCredentials:(NSString *)_creds {
-  unsigned idx;
+  NSRange rng;
   NSString *login, *pwd;
   NSString *k;
   
@@ -65,12 +67,13 @@
   k = [k stringByDecodingBase64];
   if (k == nil) return nil;
 
-  if ((idx = [k indexOfString:@":"]) == NSNotFound) {
+  rng = [k rangeOfString:@":"];
+  if (rng.length <= 0) {
     [self logWithFormat:@"got malformed basic credentials !"];
     return nil;
   }
-  login = [k substringToIndex:idx];
-  pwd   = [k substringFromIndex:(idx + 1)];
+  login = [k substringToIndex:rng.location];
+  pwd   = [k substringFromIndex:(rng.location + 1)];
   return [NSArray arrayWithObjects:login, pwd, nil];
 }
 
@@ -143,8 +146,8 @@
   NSString *auth;
   NSString *k;
   NSString *user, *pwd;
-  unsigned idx;
-  
+  NSRange rng;
+
   if ((auth = [[_ctx request] headerForKey:@"authorization"]) == nil) {
     /* no authentication provided */
     static NSArray *anon = nil;
@@ -172,17 +175,18 @@
     [r appendContentString:@"could not decode base64 credentials"];
     return r;
   }
-  
-  if ((idx = [k indexOfString:@":"]) == NSNotFound) {
+
+  rng = [k rangeOfString:@":"];
+  if (rng.length <= 0) {
     [self logWithFormat:@"got malformed basic credentials !"];
     [r setStatus:400 /* bad request */];
     [r appendContentString:@"did not find colon separator in credentials"];
     return r;
   }
-  
-  user = [k substringToIndex:idx];
-  pwd  = [k substringFromIndex:(idx + 1)];
-  
+
+  user = [k substringToIndex:rng.location];
+  pwd  = [k substringFromIndex:(rng.location + 1)];
+
   if ([user length] == 0) {
     [self logWithFormat:@"got malformed basic credentials !"];
     [r setStatus:400 /* bad request */];
diff -ru skyrix-sope-old/NGObjWeb/SoObjects/WORequest+So.m skyrix-sope-new/NGObjWeb/SoObjects/WORequest+So.m
--- skyrix-sope-old/NGObjWeb/SoObjects/WORequest+So.m	2003-07-17 18:41:46.000000000 +0200
+++ skyrix-sope-new/NGObjWeb/SoObjects/WORequest+So.m	2003-07-25 12:03:49.000000000 +0200
@@ -116,24 +116,24 @@
       <methodCall><methodName>x</methodName></methodCall>
     */
     NSString *s;
-    unsigned cidx, nidx;
-    
+    NSRange crng, nrng;
+
     s = [self contentAsString];
     if ([s length] < 51)
       return NO;
-    
-    if ((cidx = [s indexOfString:@"<methodCall>"]) == NSNotFound)
-      return NO;
-    if ((nidx = [s indexOfString:@"<methodName>"]) == NSNotFound)
-      return NO;
-    if (nidx < cidx) return NO;
-    
-    if ((cidx = [s indexOfString:@"</methodCall>"]) == NSNotFound)
-      return NO;
-    if ((nidx = [s indexOfString:@"</methodName>"]) == NSNotFound)
-      return NO;
-    if (nidx > cidx) return NO;
-    
+
+    crng = [s rangeOfString:@"<methodCall>"];
+    nrng = [s rangeOfString:@"<methodName>"];
+    if (crng.length <= 0) return NO;
+    if (nrng.length <= 0) return NO;
+    if (nrng.location < crng.location) return NO;
+
+    crng = [s rangeOfString:@"</methodCall>"];
+    nrng = [s rangeOfString:@"</methodName>"];
+    if (crng.length <= 0) return NO;
+    if (nrng.length <= 0) return NO;
+    if (nrng.location > crng.location) return NO;
+
     [self debugWithFormat:
 	    @"classified as XML-RPC because of POST and the contents "
 	    @"looks like XML-RPC "];
diff -ru skyrix-sope-old/NGObjWeb/WODirectAction.m skyrix-sope-new/NGObjWeb/WODirectAction.m
--- skyrix-sope-old/NGObjWeb/WODirectAction.m	2003-07-17 18:41:42.000000000 +0200
+++ skyrix-sope-new/NGObjWeb/WODirectAction.m	2003-07-25 12:19:20.000000000 +0200
@@ -84,12 +84,13 @@
 
 - (id<WOActionResults>)performActionNamed:(NSString *)_actionName {
   SEL actionSel;
-  unsigned idx;
+  NSRange rng;
 
   /* discard everything after a point in the URL */
-  if ((idx = [_actionName indexOfString:@"."]) != NSNotFound)
-    _actionName = [_actionName substringToIndex:idx];
-  
+  rng = [_actionName rangeOfString:@"."];
+  if (rng.length > 0)
+    _actionName = [_actionName substringToIndex:rng.location];
+
   _actionName = [_actionName stringByAppendingString:@"Action"];
   actionSel   = NSSelectorFromString(_actionName);
   
diff -ru skyrix-sope-old/NGObjWeb/WOHttpAdaptor/WOHttpTransaction.m skyrix-sope-new/NGObjWeb/WOHttpAdaptor/WOHttpTransaction.m
--- skyrix-sope-old/NGObjWeb/WOHttpAdaptor/WOHttpTransaction.m	2003-07-17 18:41:47.000000000 +0200
+++ skyrix-sope-new/NGObjWeb/WOHttpAdaptor/WOHttpTransaction.m	2003-07-25 12:19:41.000000000 +0200
@@ -304,8 +304,8 @@
   [mr setStatus:500];
   
   accept = [woRequest headerForKey:@"accept"];
-  
-  if ([accept indexOfString:@"text/html"] != NSNotFound) {
+
+  if ([accept rangeOfString:@"text/html"].length > 0) {
     const unsigned char *txt = "could not perform request !<br />";
     [mr setHeader:@"text/html" forKey:@"content-type"];
     [mr setContent:[NSData dataWithBytes:txt length:strlen(txt)]];
diff -ru skyrix-sope-old/NGObjWeb/WOPageRequestHandler.m skyrix-sope-new/NGObjWeb/WOPageRequestHandler.m
--- skyrix-sope-old/NGObjWeb/WOPageRequestHandler.m	2003-07-17 18:41:42.000000000 +0200
+++ skyrix-sope-new/NGObjWeb/WOPageRequestHandler.m	2003-07-25 12:20:18.000000000 +0200
@@ -196,12 +196,13 @@
 
 - (id<WOActionResults>)performActionNamed:(NSString *)_actionName {
   SEL actionSel;
-  unsigned idx;
-  
+  NSRange rng;
+
   /* discard everything after a point in the URL */
-  if ((idx = [_actionName indexOfString:@"."]) != NSNotFound)
-    _actionName = [_actionName substringToIndex:idx];
-  
+  rng = [_actionName rangeOfString:@"."];
+  if (rng.length > 0)
+    _actionName = [_actionName substringToIndex:rng.location];
+
   _actionName = [_actionName stringByAppendingString:@"Action"];
   
   if ((actionSel = NSSelectorFromString(_actionName)) == NULL) {
diff -ru skyrix-sope-old/NGObjWeb/WORequest.m skyrix-sope-new/NGObjWeb/WORequest.m
--- skyrix-sope-old/NGObjWeb/WORequest.m	2003-07-17 18:41:42.000000000 +0200
+++ skyrix-sope-new/NGObjWeb/WORequest.m	2003-07-25 12:20:54.000000000 +0200
@@ -30,6 +30,7 @@
 #include <time.h>
 #include "common.h"
 #include "NGHttp+WO.h"
+#include <NGExtensions/NSString+Ext.h>
 
 NGObjWeb_DECLARE NSString *WORequestValueData       = @"wodata";
 NGObjWeb_DECLARE NSString *WORequestValueInstance   = @"woinst";
@@ -552,17 +553,20 @@
   }
   
   if ((ua = [self headerForKey:@"user-agent"])) {
-    unsigned idx;
+    NSRange rng;
+
     /*
       user-agent sometimes stores the browser-language,
       eg: Opera/5.0 (Linux 2.2.18 i686; U)  [en]
     */
-    if ((idx = [ua indexOfString:@"["]) != NSNotFound) {
+    rng = [ua rangeOfString:@"["];
+    if (rng.length > 0) {
       NSString *tmp;
-      
-      tmp = [ua substringFromIndex:(idx + 1)];
-      if ((idx = [tmp indexOfString:@"]"]) != NSNotFound) {
-        tmp = [tmp substringToIndex:idx];
+
+      tmp = [ua substringFromIndex:(rng.location + 1)];
+      rng = [tmp rangeOfString:@"]"];
+      if (rng.length > 0) {
+        tmp = [tmp substringToIndex:rng.location];
       }
 
       if ((tmp = [self languageForBrowserLanguageCode:tmp]))
diff -ru skyrix-sope-old/NGObjWeb/WORequestHandler.m skyrix-sope-new/NGObjWeb/WORequestHandler.m
--- skyrix-sope-old/NGObjWeb/WORequestHandler.m	2003-07-17 18:41:42.000000000 +0200
+++ skyrix-sope-new/NGObjWeb/WORequestHandler.m	2003-07-25 12:21:16.000000000 +0200
@@ -360,11 +360,11 @@
   
   if ((ua = [self headerForKey:@"user-agent"]) == nil)
     return NO;
-  
-  if ([ua indexOfString:@"Konqueror"] != NSNotFound)
+
+  if ([ua rangeOfString:@"Konqueror"].length > 0)
     return YES;
-  else if ([ua indexOfString:@"MSIE"] != NSNotFound)
-    return [ua indexOfString:@"Mac"] != NSNotFound ? YES : NO;
+  else if ([ua rangeOfString:@"MSIE"].length > 0)
+    return [ua rangeOfString:@"Mac"].length > 0 ? YES : NO;
   else
     return NO;
 }
diff -ru skyrix-sope-old/NGObjWeb/WOSession.m skyrix-sope-new/NGObjWeb/WOSession.m
--- skyrix-sope-old/NGObjWeb/WOSession.m	2003-07-17 18:41:42.000000000 +0200
+++ skyrix-sope-new/NGObjWeb/WOSession.m	2003-07-25 12:21:42.000000000 +0200
@@ -419,7 +419,7 @@
         
         diff = [[NSDateClass date] timeIntervalSince1970] - st;
         printf("prof[%s %s]: %0.3fs\n",
-               [[page name] cString], sel_get_name(_cmd), diff);
+               [[(WOComponent *)page name] cString], sel_get_name(_cmd), diff);
       }
       
       WOContext_leaveComponent(_ctx, page);
@@ -466,7 +466,8 @@
           
           diff = [[NSDateClass date] timeIntervalSince1970] - st;
           printf("prof[%s %s]: %0.3fs\n",
-                 [[page name] cString], sel_get_name(_cmd), diff);
+                 [[(WOComponent *)page name] cString], sel_get_name(_cmd), diff);
+                 //[page name], sel_get_name(_cmd), diff);
         }
       
         WOContext_leaveComponent(_ctx, page);
@@ -486,8 +487,8 @@
     NSString *ctype;
     
     ctype = [_response headerForKey:@"content-type"];
-    
-    if ([ctype indexOfString:@"html"] != NSNotFound)
+
+    if ([ctype rangeOfString:@"html"].length > 0)
       // profiling OSX: 3.1% of append...
       [_response disableClientCaching];
   }
diff -ru skyrix-sope-old/NGObjWeb/WOStats.m skyrix-sope-new/NGObjWeb/WOStats.m
--- skyrix-sope-old/NGObjWeb/WOStats.m	2003-07-17 18:41:42.000000000 +0200
+++ skyrix-sope-new/NGObjWeb/WOStats.m	2003-07-25 12:22:13.000000000 +0200
@@ -56,13 +56,14 @@
     lines = [[s componentsSeparatedByString:@"\n"] objectEnumerator];
     while ((s = [lines nextObject])) {
       NSString *key;
-      int idx;
-      
-      if ((idx = [s indexOfString:@":"]) == NSNotFound)
+      NSRange rng;
+
+      rng = [s rangeOfString:@":"];
+      if (rng.length <= 0)
         continue;
 
-      key = [s substringToIndex:idx];
-      
+      key = [s substringToIndex:rng.location];
+
       if ([key hasPrefix:@"Vm"]) {
         const char *cstr;
         id value;
diff -ru skyrix-sope-old/SxComponents/sxc_call.m skyrix-sope-new/SxComponents/sxc_call.m
--- skyrix-sope-old/SxComponents/sxc_call.m	2003-07-17 18:41:48.000000000 +0200
+++ skyrix-sope-new/SxComponents/sxc_call.m	2003-07-25 12:22:44.000000000 +0200
@@ -223,8 +223,8 @@
   }
   
   /* process this syntax: "a=2,b=3,c=9" */
-  
-  if ([_arg indexOfString:@"="] != NSNotFound) {
+
+  if ([_arg rangeOfString:@"="].length > 0) {
     NSEnumerator        *pairs;
     NSMutableDictionary *md;
     NSString *s;
@@ -700,8 +700,8 @@
   }
   
   /* lookup component */
-  
-  if ((component = [reg getComponent:[args objectAtIndex:1]]) == nil) {
+
+  if ((component = (SxComponent *)[reg getComponent:[args objectAtIndex:1]]) == nil) {
     NSLog(@"did not find component named '%@'.",
           [args objectAtIndex:1]);
     [self exit:EXIT_MISSING_COMPONENT];
diff -ru skyrix-sope-old/WEExtensions/WECalendarField.m skyrix-sope-new/WEExtensions/WECalendarField.m
--- skyrix-sope-old/WEExtensions/WECalendarField.m	2003-07-17 18:41:49.000000000 +0200
+++ skyrix-sope-new/WEExtensions/WECalendarField.m	2003-07-25 11:26:33.000000000 +0200
@@ -1062,10 +1062,10 @@
     else {
       NSString *fmt = [self->format stringValueInComponent:_comp];
 
-      return ([fmt indexOfString:@"S"] == NSNotFound) ? NO : YES;
+      return ([fmt rangeOfString:@"S"].length > 0) ? YES : NO;
     }
-  } 
-  return (self->second != nil);  
+  }
+  return (self->second != nil);
 }
 
 - (BOOL)hasMinuteInComponent:(WOComponent *)_comp {
@@ -1075,9 +1075,9 @@
     else {
       NSString *fmt = [self->format stringValueInComponent:_comp];
 
-      return ([fmt indexOfString:@"M"] == NSNotFound) ? NO : YES;
+      return ([fmt rangeOfString:@"M"].length > 0) ? YES : NO;
     }
-  } 
+  }
   return (self->minute != nil);
 }
 
@@ -1088,9 +1088,9 @@
     else {
       NSString *fmt = [self->format stringValueInComponent:_comp];
 
-      return ([fmt indexOfString:@"H"] == NSNotFound) ? NO : YES;
+      return ([fmt rangeOfString:@"H"].length > 0) ? YES : NO;
     }
-  } 
+  }
   return (self->hour != nil);
 }
 
@@ -1101,10 +1101,10 @@
     else {
       NSString *fmt = [self->format stringValueInComponent:_comp];
 
-      return ([fmt indexOfString:@"d"] == NSNotFound) ? NO : YES;
+      return ([fmt rangeOfString:@"d"].length > 0) ? YES : NO;
     }
-  } 
-  return (self->day != nil);  
+  }
+  return (self->day != nil);
 }
 
 - (BOOL)hasMonthInComponent:(WOComponent *)_comp {
@@ -1114,10 +1114,10 @@
     else {
       NSString *fmt = [self->format stringValueInComponent:_comp];
 
-      return ([fmt indexOfString:@"m"] == NSNotFound) ? NO : YES;
+      return ([fmt rangeOfString:@"m"].length > 0) ? YES : NO;
     }
   }
-  return (self->month != nil);  
+  return (self->month != nil);
 }
 
 - (BOOL)hasYearInComponent:(WOComponent *)_comp {
@@ -1127,10 +1127,10 @@
     else {
       NSString *fmt = [self->format stringValueInComponent:_comp];
 
-      return ([fmt indexOfString:@"Y"] == NSNotFound) ? NO : YES;
+      return ([fmt rangeOfString:@"Y"].length > 0) ? YES : NO;
     }
   }
-  return (self->year != nil);  
+  return (self->year != nil);
 }
 
 @end
diff -ru skyrix-sope-old/WEExtensions/WEMonthOverview.m skyrix-sope-new/WEExtensions/WEMonthOverview.m
--- skyrix-sope-old/WEExtensions/WEMonthOverview.m	2003-07-17 18:41:49.000000000 +0200
+++ skyrix-sope-new/WEExtensions/WEMonthOverview.m	2003-07-25 12:08:20.000000000 +0200
@@ -20,9 +20,12 @@
 */
 // $Id: #
 
-#import <Foundation/Foundation.h>
+#include <Foundation/Foundation.h>
 #include <NGObjWeb/NGObjWeb.h>
-#import "WEContextConditional.h"
+#include "WEContextConditional.h"
+
+/* Needed for ceil()/floor() */
+#include <js/jslibmath.h>
 
 static NSString *WEMonthOverview_InfoMode    = @"WEMonthOverview_InfoMode";
 static NSString *WEMonthOverview_ContentMode = @"WEMonthOverview_ContentMode";
@@ -902,7 +905,7 @@
   BOOL         isEdge;
   
   orient = [self->orientation valueInComponent:[_ctx component]];
-  isEdge = [orient indexOfString:@"/"] != NSNotFound;
+  isEdge = ([orient rangeOfString:@"/"].length > 0);
 
   op  = [_ctx valueForKey:@"WEMonthOverview"];
   if ((tmp = [op objectForKey:orient])) {
@@ -925,7 +928,7 @@
   id           result;
   
   orient = [self->orientation valueInComponent:[_ctx component]];
-  isEdge = [orient indexOfString:@"/"] != NSNotFound;
+  isEdge = ([orient rangeOfString:@"/"].length > 0);
 
   op  = [_ctx valueForKey:@"WEMonthOverview"];
   if ((tmp = [op objectForKey:orient])) {
@@ -969,7 +972,7 @@
   int      cols = -1;
 
   orient = [self->orientation valueInComponent:[_ctx component]];
-  isEdge = [orient indexOfString:@"/"] != NSNotFound;
+  isEdge = ([orient rangeOfString:@"/"].length > 0);
 
   if (orient == nil) return;
   
diff -ru skyrix-sope-old/WEExtensions/common.h skyrix-sope-new/WEExtensions/common.h
--- skyrix-sope-old/WEExtensions/common.h	2003-07-17 18:41:49.000000000 +0200
+++ skyrix-sope-new/WEExtensions/common.h	2003-07-25 11:18:51.000000000 +0200
@@ -63,7 +63,7 @@
                          inFramework:nil
                          languages:languages
                          request:[_ctx request]];
-  if ([uri indexOfString:@"/missingresource?"] != NSNotFound)
+  if ([uri rangeOfString:@"/missingresource?"].length > 0)
     uri = nil;
   
   return uri;
diff -ru skyrix-sope-old/WOExtensions/WODictionaryRepetition.m skyrix-sope-new/WOExtensions/WODictionaryRepetition.m
--- skyrix-sope-old/WOExtensions/WODictionaryRepetition.m	2003-07-17 18:41:50.000000000 +0200
+++ skyrix-sope-new/WOExtensions/WODictionaryRepetition.m	2003-07-25 11:18:51.000000000 +0200
@@ -66,7 +66,7 @@
   return _key;
 }
 - (NSString *)escapeKey:(NSString *)_key {
-  if ([_key indexOfString:@"."] != NSNotFound) {
+  if ([_key rangeOfString:@"."].length > 0) {
     NSLog(@"WARNING(%s): key '%@' can't be processed by "
           @"WODictionaryRepetition !!",
           __PRETTY_FUNCTION__, _key);
diff -ru skyrix-sope-old/WOExtensions/common.h skyrix-sope-new/WOExtensions/common.h
--- skyrix-sope-old/WOExtensions/common.h	2003-07-17 18:41:50.000000000 +0200
+++ skyrix-sope-new/WOExtensions/common.h	2003-07-25 11:18:51.000000000 +0200
@@ -59,7 +59,7 @@
                          inFramework:nil
                          languages:languages
                          request:[_ctx request]];
-  if ([uri indexOfString:@"/missingresource?"] != NSNotFound)
+  if ([uri rangeOfString:@"/missingresource?"].length > 0)
     uri = nil;
   
   return uri;

--VbJkn9YxBvnuCH5J--