fix TC failure
authorGwangbok Kim <gwangbok.kim@samsung.com>
Mon, 5 Aug 2013 11:57:08 +0000 (20:57 +0900)
committerGwangbok Kim <gwangbok.kim@samsung.com>
Mon, 5 Aug 2013 11:57:08 +0000 (20:57 +0900)
Change-Id: Iec38d5ec11b76c2f3cb4e4aac486d239db63244d
Signed-off-by: Gwangbok Kim <gwangbok.kim@samsung.com>
src/FScl_AddressbookImpl.cpp

index b13e613..c747495 100644 (file)
@@ -939,13 +939,17 @@ _AddressbookImpl::SearchContactsByPhoneNumberN(const String& phoneNumber) const
        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;
@@ -1877,12 +1881,12 @@ _AddressbookImpl::CopyContactRecordHandle(contacts_record_h srcHandle)
        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