From 83d0ee535ca624efbe168561c45caca0e6c42d4b Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Wed, 27 Jul 2011 21:51:44 +0000 Subject: [PATCH] Monotone-Parent: 2fba878ec8713c26f41ffeb5cf08c75601a7c6b0 Monotone-Revision: 88ed6891d1a0ab07ab5cd6b7f28144e585e93c30 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2011-07-27T21:51:44 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 3 +++ OpenChange/NSArray+MAPIStore.h | 3 ++- OpenChange/NSArray+MAPIStore.m | 10 +++++----- 3 files changed, 10 insertions(+), 6 deletions(-) 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; }