34MacabGroup::MacabGroup(
const ABAddressBookRef _addressBook,
const MacabRecords *_allRecords,
const ABGroupRef _xGroup)
37 sal_Int32
i, j, nAllRecordsSize;
38 CFArrayRef xGroupMembers = ABGroupCopyArrayOfAllMembers(_xGroup);
40 CFStringRef sGroupMemberUID;
45 CFStringRef sGroupName;
46 sGroupName =
static_cast<CFStringRef
>(ABRecordCopyValue(_xGroup, kABGroupNameProperty));
48 CFRelease(sGroupName);
51 recordsSize =
static_cast<sal_Int32
>(CFArrayGetCount(xGroupMembers));
60 nAllRecordsSize = _allRecords->
size();
63 xPerson =
static_cast<ABPersonRef
>(
const_cast<void *
>(CFArrayGetValueAtIndex(xGroupMembers,
i)));
64 if(xPerson !=
nullptr)
66 sGroupMemberUID =
static_cast<CFStringRef
>(ABRecordCopyValue(xPerson, kABUIDProperty));
67 if(sGroupMemberUID !=
nullptr)
70 for(j = 0; j < nAllRecordsSize; j++)
73 if(xRecordField !=
nullptr && xRecordField->
value !=
nullptr)
75 if(CFEqual(xRecordField->
value, sGroupMemberUID))
84 OSL_ENSURE(bFound,
"MacabGroup::MacabGroup : Could not find group member based on UID!");
85 CFRelease(sGroupMemberUID);
90 CFRelease(xGroupMembers);
void setHeader(MacabHeader *_header)
macabfield * getField(const sal_Int32 _recordNumber, const sal_Int32 _columnNumber) const
MacabHeader * getHeader() const
MacabRecord * insertRecord(MacabRecord *_newRecord, const sal_Int32 _location)
MacabRecord * getRecord(const sal_Int32 _location) const
OUString CFStringToOUString(const CFStringRef sOrig)