Fix for N_SE-40030,N_SE-40037,N_SE-40040,N_SE-40076,N_SE-40186,N_SE-40041
authorBhavya Kumili <bhavya.k@samsung.com>
Fri, 31 May 2013 12:14:46 +0000 (17:44 +0530)
committerBhavya Kumili <bhavya.k@samsung.com>
Fri, 31 May 2013 13:01:14 +0000 (18:31 +0530)
Change-Id: I6433816d4696fcde946228b65f6afaf8d3af0337

src/ui/controls/FUiCtrl_DateTimeBar.cpp
src/ui/controls/FUiCtrl_EditDatePresenter.cpp
src/ui/controls/FUiCtrl_EditTimePresenter.cpp
src/ui/inc/FUiCtrl_DateTimeBar.h

index dc0b98c..ba0a1f5 100644 (file)
@@ -51,6 +51,7 @@ _DateTimeBar::_DateTimeBar(void)
        , __parentWindowBounds(0.0f, 0.0f, 0.0f, 0.0f)
        , __pOwner(null)
        , __accessibilityFocusOutIndex(-1)
+       , __isAnimating(false)
 {
 
 }
@@ -358,6 +359,10 @@ bool
 _DateTimeBar::OnTouchPressed(const _Control& source, const _TouchInfo& touchinfo)
 {
        ClearLastResult();
+       if (__isAnimating)
+       {
+               return true;
+       }
 
        return __pDateTimeBarPresenter->OnTouchPressed(source, touchinfo);
 }
@@ -366,6 +371,10 @@ bool
 _DateTimeBar::OnTouchReleased(const _Control& source, const _TouchInfo& touchinfo)
 {
        ClearLastResult();
+       if (__isAnimating)
+       {
+               return true;
+       }
 
        return __pDateTimeBarPresenter->OnTouchReleased(source, touchinfo);
 }
@@ -374,6 +383,10 @@ bool
 _DateTimeBar::OnTouchMoved(const _Control& source, const _TouchInfo& touchinfo)
 {
        ClearLastResult();
+       if (__isAnimating)
+       {
+               return true;
+       }
 
        return __pDateTimeBarPresenter->OnTouchMoved(source, touchinfo);
 }
@@ -905,6 +918,7 @@ _DateTimeBar::CloseDateTimeBar()
        VisualElement* pVisualElement = null;
        VisualElementAnimation *pAnimation = null;
 
+       __isAnimating = true;
        pVisualElement = GetVisualElement();
        SysTryReturnVoidResult(NID_UI_CTRL, pVisualElement != null, E_SYSTEM, "[E_SYSTEM] A system error has occurred. Failed to get visual element.");
        pAnimation = CreateAnimationN(*pVisualElement, false);
@@ -931,6 +945,7 @@ _DateTimeBar::OnVisualElementAnimationFinished (const VisualElementAnimation &an
                Close();
                target.SetBounds(bounds);
        }
+       __isAnimating = false;
 
        delete pUserData;
 }
index a777213..5ee67ce 100644 (file)
@@ -1301,6 +1301,7 @@ _EditDatePresenter::OnTouchMoveHandled(const _Control& control)
 void
 _EditDatePresenter::Animate(void)
 {
+       SysTryReturnVoidResult(NID_UI_CTRL, !__isAnimating, E_SUCCESS, "Rolling animation is in progress.");
        SysAssertf((__pFont != null), "Font instance must not be null.");
 
        (_FontImpl::GetInstance(*__pFont))->SetSize(__dateFontSize);
@@ -1391,6 +1392,7 @@ _EditDatePresenter::Animate(void)
        if (r != E_SUCCESS)
        {
                pNewVisualElement->Destroy();
+               pNewVisualElement = null;
        }
        SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
 
@@ -1398,6 +1400,7 @@ _EditDatePresenter::Animate(void)
        if (pOldVisualElement == null)
        {
                pNewVisualElement->Destroy();
+               pNewVisualElement = null;
        }
        SysTryCatch(NID_UI_CTRL, (pOldVisualElement != null), , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
 
@@ -1406,6 +1409,8 @@ _EditDatePresenter::Animate(void)
        {
                pNewVisualElement->Destroy();
                pOldVisualElement->Destroy();
+               pNewVisualElement = null;
+               pOldVisualElement = null;
        }
        SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
 
@@ -1518,6 +1523,7 @@ _EditDatePresenter::Animate(void)
        CATCH:
        __isAnimating = false;
        __pContentProvider->Destroy();
+       __pContentProvider = null;
 
        delete pNewBoundsAnimation;
        pNewBoundsAnimation = null;
@@ -1543,6 +1549,7 @@ _EditDatePresenter::OnVisualElementAnimationFinished (const VisualElementAnimati
 
        pEditDateElement->DetachChild(*__pContentProvider);
        __pContentProvider->Destroy();
+       __pContentProvider = null;
 
        Draw();
        return;
index 5f49167..cbe4262 100644 (file)
@@ -1678,6 +1678,7 @@ _EditTimePresenter::UpdateTimeFormat(void)
 void
 _EditTimePresenter::Animate(void)
 {
+       SysTryReturnVoidResult(NID_UI_CTRL, !__isAnimating, E_SUCCESS, "Rolling animation is in progress.");
        SysAssertf((__pFont != null), "Font instance must not be null.");
 
        (_FontImpl::GetInstance(*__pFont))->SetSize(__timeFontSize);
@@ -1770,6 +1771,7 @@ _EditTimePresenter::Animate(void)
        if (r != E_SUCCESS)
        {
                pNewVisualElement->Destroy();
+               pNewVisualElement = null;
        }
        SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
 
@@ -1779,6 +1781,7 @@ _EditTimePresenter::Animate(void)
        if (pOldVisualElement == null)
        {
                pNewVisualElement->Destroy();
+               pNewVisualElement = null;
        }
        SysTryCatch(NID_UI_CTRL, (pOldVisualElement != null), , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
 
@@ -1787,6 +1790,8 @@ _EditTimePresenter::Animate(void)
        {
                pNewVisualElement->Destroy();
                pOldVisualElement->Destroy();
+               pNewVisualElement = null;
+               pOldVisualElement = null;
        }
        SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
 
@@ -1897,6 +1902,7 @@ _EditTimePresenter::Animate(void)
 CATCH:
        __isAnimating = false;
        __pContentProvider->Destroy();
+       __pContentProvider = null;
 
        delete pNewBoundsAnimation;
        pNewBoundsAnimation = null;
@@ -1922,6 +1928,7 @@ _EditTimePresenter::OnVisualElementAnimationFinished (const VisualElementAnimati
 
        pEditTimeElement->DetachChild(*__pContentProvider);
        __pContentProvider->Destroy();
+       __pContentProvider = null;
 
        Draw();
        return;
index 5b29b2d..419f285 100644 (file)
@@ -157,6 +157,7 @@ private:
        Tizen::Graphics::FloatRectangle __parentWindowBounds;
        _Control* __pOwner;
        int __accessibilityFocusOutIndex;
+       bool __isAnimating;
 }; // _DateTimeBar
 
 }}} // Tizen::Ui::Controls