From 36a5c192f032665b3fa8e766c4a18a1ea2e0be5d Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Thu, 7 Jun 2007 16:19:02 +0000 Subject: [PATCH] Monotone-Parent: 4e643e3e8f08c6cdd2abe4483bdb2cdb7dc15066 Monotone-Revision: 24cd0f4a54d77d53f8c9e4dc117f32e9a5c42d72 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-06-07T16:19:02 Monotone-Branch: ca.inverse.sogo --- SOPE/NGCards/CardElement.h | 18 ++++++++++++++++++ SOPE/NGCards/ChangeLog | 3 +++ 2 files changed, 21 insertions(+) diff --git a/SOPE/NGCards/CardElement.h b/SOPE/NGCards/CardElement.h index d4fd0315a..ebd89f1e4 100644 --- a/SOPE/NGCards/CardElement.h +++ b/SOPE/NGCards/CardElement.h @@ -106,4 +106,22 @@ @end +#define IS_EQUAL(a,b,sel) \ + _iCalSafeCompareObjects (a, b, @selector(sel)) + +static __inline__ BOOL _iCalSafeCompareObjects(id a, id b, SEL comparator) +{ + id va = a; + id vb = b; + BOOL (*compm)(id, SEL, id); + + if((!va && vb) || (va && !vb)) + return NO; + else if(va == vb) + return YES; + compm = (BOOL (*)( id, SEL, id)) [va methodForSelector: comparator]; + + return compm(va, comparator, vb); +} + #endif /* CARDELEMENT_H */ diff --git a/SOPE/NGCards/ChangeLog b/SOPE/NGCards/ChangeLog index 75dbaa41c..0d22b7c97 100644 --- a/SOPE/NGCards/ChangeLog +++ b/SOPE/NGCards/ChangeLog @@ -1,5 +1,8 @@ 2007-06-07 Wolfgang Sourdeau + * CardElement.h: moved IS_EQUAL macro from removed module + "common.h". + * CardGroup+iCal.[hm]: removed category module. 2007-04-27 Wolfgang Sourdeau