Monotone-Parent: 2fba878ec8713c26f41ffeb5cf08c75601a7c6b0

Monotone-Revision: 88ed6891d1a0ab07ab5cd6b7f28144e585e93c30

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2011-07-27T21:51:44
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau
2011-07-27 21:51:44 +00:00
parent 9426768dcd
commit 83d0ee535c
3 changed files with 10 additions and 6 deletions

View File

@@ -1,5 +1,8 @@
2011-07-27 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* 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.

View File

@@ -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

View File

@@ -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;
}