diff --git a/ChangeLog b/ChangeLog index 89844144b..d30197a20 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2011-07-27 Wolfgang Sourdeau + * OpenChange/NSArray+MAPIStore.m (-asArrayOfUnicodeStringsInCtx:): + the return type is now "struct WStringArray_r *". + * OpenChange/NSString+MAPIStore.m (-asUnicodeInMemCtx): return an empty string when length == 0, otherwise the resulting pointer will be NULL. diff --git a/OpenChange/NSArray+MAPIStore.h b/OpenChange/NSArray+MAPIStore.h index 4d9a006a8..d92095cc6 100644 --- a/OpenChange/NSArray+MAPIStore.h +++ b/OpenChange/NSArray+MAPIStore.h @@ -27,7 +27,8 @@ @interface NSArray (MAPIStoreFolders) -- (struct mapi_SPLSTRArrayW *) asArrayOfUnicodeStringsInCtx: (void *) memCtx; +- (struct WStringArray_r *) asArrayOfUnicodeStringsInCtx: (void *) memCtx; +// - (struct mapi_SPLSTRArrayW *) asArrayOfUnicodeStringsInCtx: (void *) memCtx; @end diff --git a/OpenChange/NSArray+MAPIStore.m b/OpenChange/NSArray+MAPIStore.m index 4888c6846..a651888f4 100644 --- a/OpenChange/NSArray+MAPIStore.m +++ b/OpenChange/NSArray+MAPIStore.m @@ -32,19 +32,19 @@ @implementation NSArray (MAPIStoreFolders) -- (struct mapi_SPLSTRArrayW *) asArrayOfUnicodeStringsInCtx: (void *) memCtx +- (struct WStringArray_r *) asArrayOfUnicodeStringsInCtx: (void *) memCtx { - struct mapi_SPLSTRArrayW *list; + struct WStringArray_r *list; NSInteger count, max; max = [self count]; - list = talloc_zero(memCtx, struct mapi_SPLSTRArrayW); + list = talloc_zero(memCtx, struct WStringArray_r); list->cValues = max; - list->strings = talloc_array(list, struct mapi_LPWSTR, max); + list->lppszW = talloc_array(list, const char *, max); for (count = 0; count < max; count++) - (list->strings + count)->lppszW = [[self objectAtIndex: count] asUnicodeInMemCtx: list->strings]; + list->lppszW[count] = [[self objectAtIndex: count] asUnicodeInMemCtx: list->lppszW]; return list; }