fix N_SE-41101
authorGwangbok Kim <gwangbok.kim@samsung.com>
Wed, 12 Jun 2013 02:18:39 +0000 (11:18 +0900)
committerGwangbok Kim <gwangbok.kim@samsung.com>
Wed, 12 Jun 2013 02:18:39 +0000 (11:18 +0900)
Change-Id: Id20d6ae564bcbd0792ac6dfb74d3cbf2611ac7b8
Signed-off-by: Gwangbok Kim <gwangbok.kim@samsung.com>
project/src/EditContactForm.cpp

index ca0037c..cfa0fa5 100644 (file)
@@ -227,18 +227,29 @@ EditContactForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionI
        {
                case ID_FOOTER_SAVE:
                {
-                       SaveContact(__selectedTabId);
+                       SceneManager* pSceneManager = SceneManager::GetInstance();
+                       AppAssert(pSceneManager);
+
+                       result r = E_SUCCESS;
+                       r = SaveContact(__selectedTabId);
+                       if (IsFailed(r))
+                       {
+                               MessageBox messageBox;
+                               messageBox.Construct(L"Error", "Failed to update contact", MSGBOX_STYLE_OK, 0);
+                               int doModal;
+                               messageBox.ShowAndWait(doModal);
+
+                               pSceneManager->GoBackward(BackwardSceneTransition(SCENE_MAIN_FORM));
+                       }
 
                        ArrayList* pPersonIdList = new (std::nothrow) ArrayList();
                        AppAssert(pPersonIdList);
-                       result r = E_SUCCESS;
+
                        r = pPersonIdList->Construct();
                        TryReturnVoid(!IsFailed(r), "Failed to construct person list (%s).", GetErrorMessage(r));
                        r = pPersonIdList->Add(*new (std::nothrow) Integer(__personId));
                        TryReturnVoid(!IsFailed(r), "Failed to get add contact record id (%s).", GetErrorMessage(r));
 
-                       SceneManager* pSceneManager = SceneManager::GetInstance();
-                       AppAssert(pSceneManager);
                        pSceneManager->GoBackward(BackwardSceneTransition(SCENE_DETAIL_VIEW_FORM), pPersonIdList);
 
                        break;
@@ -658,15 +669,6 @@ EditContactForm::SaveContact(int index)
        }
 
        r = __pAddressbookMgr->UpdateContact(*pContact);
-
-       if(IsFailed(r))
-       {
-               MessageBox messageBox;
-               messageBox.Construct(L"Error", "Failed to update contact", MSGBOX_STYLE_OK, 0);
-               int doModal;
-               messageBox.ShowAndWait(doModal);
-       }
-
        TryReturn(!IsFailed(r), r, "Failed to update Contact (%s)", GetErrorMessage(r));
 
        return r;