From 6e7f9b6f7de0a62d57c8a3168500e1d28f869411 Mon Sep 17 00:00:00 2001 From: Gautier Pelloux-Prayer Date: Thu, 26 May 2016 11:02:08 +0200 Subject: [PATCH] UICompositeView.m: fix invalid Y origin for side menu --- Classes/LinphoneUI/UICompositeView.m | 4 ++-- Classes/Utils/FastAddressBook.m | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Classes/LinphoneUI/UICompositeView.m b/Classes/LinphoneUI/UICompositeView.m index b2aee4fd4..a48be7d61 100644 --- a/Classes/LinphoneUI/UICompositeView.m +++ b/Classes/LinphoneUI/UICompositeView.m @@ -584,10 +584,10 @@ // 2. side menu - fixed size, always starting below status bar (hack: except in fullscreen) CGRect sideMenuFrame = viewFrame; - sideMenuFrame.origin.y = origin + (currentViewDescription.fullscreen ? 0 : statusBarFrame.size.height); + sideMenuFrame.origin.y = origin - (currentViewDescription.fullscreen ? statusBarFrame.size.height : 0); sideMenuFrame.size.height -= sideMenuFrame.origin.y; if (!currentViewDescription.sideMenuEnabled) { - // really hide; -width won't be enough since some animations may use this... + // hack bis: really hide; -width won't be enough since some animations may use this... sideMenuFrame.origin.x = -3 * sideMenuFrame.size.width; } diff --git a/Classes/Utils/FastAddressBook.m b/Classes/Utils/FastAddressBook.m index e8b429db9..b5b9f7660 100644 --- a/Classes/Utils/FastAddressBook.m +++ b/Classes/Utils/FastAddressBook.m @@ -277,21 +277,21 @@ void sync_address_book(ABAddressBookRef addressBook, CFDictionaryRef info, void - (BOOL)saveContact:(Contact *)contact { CFErrorRef error = NULL; if (ABRecordGetRecordID(contact.person) == kABRecordInvalidID) { - ABAddressBookAddRecord(addressBook, contact.person, (CFErrorRef *)&error); - if (error != NULL) { - LOGE(@"Add contact %p: Fail(%@)", contact.person, [(__bridge NSError *)error localizedDescription]); - } else { + if (ABAddressBookAddRecord(addressBook, contact.person, (CFErrorRef *)&error)) { LOGI(@"Add contact %p: Success!", contact.person); + } else { + LOGE(@"Add contact %p: Fail(%@)", contact.person, [(__bridge NSError *)error localizedDescription]); + return FALSE; } } // Save address book error = NULL; - ABAddressBookSave(addressBook, &error); - if (error != NULL) { - LOGE(@"Save AddressBook: Fail(%@)", [(__bridge NSError *)error localizedDescription]); - } else { + if (ABAddressBookSave(addressBook, &error)) { LOGI(@"Save AddressBook: Success!"); + } else { + LOGE(@"Save AddressBook: Fail(%@)", [(__bridge NSError *)error localizedDescription]); + return FALSE; } [self reload];