std::unique_ptr<char[]> pCharArray(_StringConverter::CopyToCharArrayN(phoneNumber));
SysTryReturn(NID_SCL, pCharArray != null, null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
+ __Filter<__ContactsContactNumber> subFilter;
+ subFilter.Construct();
+ subFilter.AddString(_contacts_contact_number.normalized_number, CONTACTS_MATCH_CONTAINS, pCharArray.get());
+ subFilter.AddOperator(CONTACTS_FILTER_OPERATOR_OR);
+ subFilter.AddString(_contacts_contact_number.number, CONTACTS_MATCH_CONTAINS, pCharArray.get());
+
__Filter<__ContactsContactNumber> filter;
filter.Construct();
filter.AddInt(_contacts_contact_number.address_book_id, CONTACTS_MATCH_EQUAL, __addressbookId);
filter.AddOperator(CONTACTS_FILTER_OPERATOR_AND);
- filter.AddString(_contacts_contact_number.normalized_number, CONTACTS_MATCH_CONTAINS, pCharArray.get());
- filter.AddOperator(CONTACTS_FILTER_OPERATOR_OR);
- filter.AddString(_contacts_contact_number.number, CONTACTS_MATCH_CONTAINS, pCharArray.get());
+ filter.AddFilter(subFilter);
unsigned int projectionIds[1];
projectionIds[0] = _contacts_contact_number.contact_id;
SysTryReturn(NID_SCL, ret == CONTACTS_ERROR_NONE, null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
// favorite
- contacts_record_get_bool(sourceRecordHandle, _contacts_contact.is_favorite, &boolValue);
- contacts_record_set_bool(destRecordHandle, _contacts_contact.is_favorite, boolValue);
+ contacts_record_get_bool(srcHandle, _contacts_contact.is_favorite, &boolValue);
+ contacts_record_set_bool(contactHandle, _contacts_contact.is_favorite, boolValue);
// uid
- contacts_record_get_str_p(sourceRecordHandle, _contacts_contact.uid, &pCharValue);
- contacts_record_set_str(destRecordHandle, _contacts_contact.uid, pCharValue);
+ contacts_record_get_str_p(srcHandle, _contacts_contact.uid, &pCharValue);
+ contacts_record_set_str(contactHandle, _contacts_contact.uid, pCharValue);
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
// name