Fix for N_SE-44404
authorhs321.lee <hs321.lee@samsung.com>
Wed, 3 Jul 2013 12:46:56 +0000 (21:46 +0900)
committerhs321.lee <hs321.lee@samsung.com>
Wed, 3 Jul 2013 12:47:03 +0000 (21:47 +0900)
Change-Id: I3cc872a5489cb3cb152bf364807d6f1e71aba864
Signed-off-by: hs321.lee <hs321.lee@samsung.com>
project/inc/TodoListForm.h
project/src/CreateTodoForm.cpp
project/src/EditTodoForm.cpp
project/src/TodoListForm.cpp

index 9890f27..029be30 100644 (file)
@@ -73,7 +73,7 @@ private:
 
        Tizen::Base::Collection::IList* __pTodosList;
        Tizen::Ui::Controls::Button* __pStatusContextButton;
-       Tizen::Ui::Controls::ContextMenu* __pContextMenuStatusText;
+       Tizen::Ui::Controls::ContextMenu* __pStatusContextMenu;
        Tizen::Ui::Controls::ListView* __pListView;
        Tizen::Social::Calendarbook* __pCalendarbook;
        unsigned long __selectedStatus;
index cda2562..35f3669 100644 (file)
@@ -174,7 +174,6 @@ CreateTodoForm::OnInitializing(void)
        __pPriorityTextContextMenu->AddItem(L"Normal", ID_CONTEXT_PRIORITY_NORMAL);
        __pPriorityTextContextMenu->AddItem(L"Low", ID_CONTEXT_PRIORITY_LOW);
        __pPriorityTextContextMenu->AddActionEventListener(*this);
-       pScrollPanel->AddControl(__pPriorityTextContextMenu);
 
        // Sensitivity
        Label* pSensitivityLabel = new (std::nothrow) Label();
@@ -195,9 +194,7 @@ CreateTodoForm::OnInitializing(void)
        __pSensitivityTextContextMenu->AddItem(L"Public", ID_CONTEXT_SENSITIVITY_PUBLIC);
        __pSensitivityTextContextMenu->AddItem(L"Private", ID_CONTEXT_SENSITIVITY_PRIVATE);
        __pSensitivityTextContextMenu->AddItem(L"Confidential", ID_CONTEXT_SENSITIVITY_CONFIDENTIAL);
-
        __pSensitivityTextContextMenu->AddActionEventListener(*this);
-       pScrollPanel->AddControl(__pSensitivityTextContextMenu);
 
        // Status
        Label* pStatusLabel = new (std::nothrow) Label();
@@ -222,7 +219,6 @@ CreateTodoForm::OnInitializing(void)
        __pStatusTextContextMenu->AddItem(L"Cancelled", ID_CONTEXT_STATUS_CANCELLED);
        __pStatusTextContextMenu->SetMaxVisibleItemsCount(3);
        __pStatusTextContextMenu->AddActionEventListener(*this);
-       pScrollPanel->AddControl(__pStatusTextContextMenu);
 
        // Description
        __pDescriptionEditField = new (std::nothrow) EditField();
@@ -242,6 +238,11 @@ result
 CreateTodoForm::OnTerminating(void)
 {
        result r = E_SUCCESS;
+
+       __pPriorityTextContextMenu->Destroy();
+       __pStatusTextContextMenu->Destroy();
+       __pStatusTextContextMenu->Destroy();
+
        return r;
 }
 
index 1a2739b..6942e23 100644 (file)
@@ -178,7 +178,6 @@ EditTodoForm::OnInitializing(void)
        __pPriorityTextContextMenu->AddItem(L"Normal", ID_CONTEXT_PRIORITY_NORMAL);
        __pPriorityTextContextMenu->AddItem(L"Low", ID_CONTEXT_PRIORITY_LOW);
        __pPriorityTextContextMenu->AddActionEventListener(*this);
-       pScrollPanel->AddControl(__pPriorityTextContextMenu);
 
        // Sensitivity
        Label* pSensitivityLabel = new (std::nothrow) Label();
@@ -199,9 +198,7 @@ EditTodoForm::OnInitializing(void)
        __pSensitivityTextContextMenu->AddItem(L"Public", ID_CONTEXT_SENSITIVITY_PUBLIC);
        __pSensitivityTextContextMenu->AddItem(L"Private", ID_CONTEXT_SENSITIVITY_PRIVATE);
        __pSensitivityTextContextMenu->AddItem(L"Confidential", ID_CONTEXT_SENSITIVITY_CONFIDENTIAL);
-
        __pSensitivityTextContextMenu->AddActionEventListener(*this);
-       pScrollPanel->AddControl(__pSensitivityTextContextMenu);
 
        // Status
        Label* pStatusLabel = new (std::nothrow) Label();
@@ -226,7 +223,6 @@ EditTodoForm::OnInitializing(void)
        __pStatusTextContextMenu->AddItem(L"Cancelled", ID_CONTEXT_STATUS_CANCELLED);
        __pStatusTextContextMenu->SetMaxVisibleItemsCount(3);
        __pStatusTextContextMenu->AddActionEventListener(*this);
-       pScrollPanel->AddControl(__pStatusTextContextMenu);
 
        // Description
        __pDescriptionEditField = new (std::nothrow) EditField();
@@ -251,6 +247,11 @@ EditTodoForm::OnTerminating(void)
        {
                delete __pTodo;
        }
+
+       __pPriorityTextContextMenu->Destroy();
+       __pStatusTextContextMenu->Destroy();
+       __pStatusTextContextMenu->Destroy();
+
        return r;
 }
 
index d829099..1b08580 100644 (file)
@@ -89,15 +89,15 @@ TodoListForm::OnInitializing(void)
        __pStatusContextButton->AddActionEventListener(*this);
        AddControl(__pStatusContextButton);
 
-       __pContextMenuStatusText = new (std::nothrow) ContextMenu();
-       __pContextMenuStatusText->Construct(Point(GetClientAreaBounds().width * 5 / 6, BUTTON_HEIGHT * 3), CONTEXT_MENU_STYLE_LIST);
-       __pContextMenuStatusText->AddItem(L"All", ID_CONTEXT_STATUS_ALL);
-       __pContextMenuStatusText->AddItem(L"None", ID_CONTEXT_STATUS_NONE);
-       __pContextMenuStatusText->AddItem(L"Needs action", ID_CONTEXT_STATUS_NEEDS_ACTION);
-       __pContextMenuStatusText->AddItem(L"Completed", ID_CONTEXT_STATUS_COMPLETED);
-       __pContextMenuStatusText->AddItem(L"In process", ID_CONTEXT_STATUS_IN_PROCESS);
-       __pContextMenuStatusText->AddItem(L"Cancelled", ID_CONTEXT_STATUS_CANCELLED);
-       __pContextMenuStatusText->AddActionEventListener(*this);
+       __pStatusContextMenu = new (std::nothrow) ContextMenu();
+       __pStatusContextMenu->Construct(Point(GetClientAreaBounds().width * 5 / 6, BUTTON_HEIGHT * 3), CONTEXT_MENU_STYLE_LIST);
+       __pStatusContextMenu->AddItem(L"All", ID_CONTEXT_STATUS_ALL);
+       __pStatusContextMenu->AddItem(L"None", ID_CONTEXT_STATUS_NONE);
+       __pStatusContextMenu->AddItem(L"Needs action", ID_CONTEXT_STATUS_NEEDS_ACTION);
+       __pStatusContextMenu->AddItem(L"Completed", ID_CONTEXT_STATUS_COMPLETED);
+       __pStatusContextMenu->AddItem(L"In process", ID_CONTEXT_STATUS_IN_PROCESS);
+       __pStatusContextMenu->AddItem(L"Cancelled", ID_CONTEXT_STATUS_CANCELLED);
+       __pStatusContextMenu->AddActionEventListener(*this);
 
        __pListView = new (std::nothrow) ListView();
        __pListView->Construct(Rectangle(UI_POSITION_GAP, BUTTON_HEIGHT, GetClientAreaBounds().width, GetClientAreaBounds().height - BUTTON_HEIGHT));
@@ -125,6 +125,8 @@ TodoListForm::OnTerminating(void)
                delete __pTodosList;
        }
 
+       __pStatusContextMenu->Destroy();
+
        return r;
 }
 
@@ -142,9 +144,9 @@ TodoListForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId)
                break;
 
        case ID_BUTTON_STATUS:
-               __pContextMenuStatusText->SetFocusable(true);
-               __pContextMenuStatusText->SetShowState(true);
-               __pContextMenuStatusText->Show();
+               __pStatusContextMenu->SetFocusable(true);
+               __pStatusContextMenu->SetShowState(true);
+               __pStatusContextMenu->Show();
                break;
 
        case ID_CONTEXT_STATUS_NONE: