(ScrollView)Found issue with change made in previous patch for overshoot enabling
authorJulien Heanley <j.heanley@partner.samsung.com>
Fri, 9 May 2014 08:39:25 +0000 (09:39 +0100)
committerAdeel Kazmi <adeel.kazmi@samsung.com>
Thu, 15 May 2014 11:52:56 +0000 (12:52 +0100)
[Problem] Will crash if overshoot enable is called twice without a disable in between
[Solution] Make sure application can call to enable as many times as it wants

Change-Id: Ie7bbfe8eea8475dee9294f8949a09a40fa8df483
Signed-off-by: Julien Heanley <j.heanley@partner.samsung.com>
base/dali-toolkit/internal/controls/scrollable/scrollable-impl.cpp

index 021b908..90fb50e 100644 (file)
@@ -99,10 +99,13 @@ bool Scrollable::IsScrollComponentEnabled(Toolkit::Scrollable::ScrollComponentTy
 
 void Scrollable::EnableScrollComponent(Toolkit::Scrollable::ScrollComponentType type)
 {
-  if(type == Toolkit::Scrollable::OvershootIndicator && !mOvershootEnabled)
+  if(type == Toolkit::Scrollable::OvershootIndicator)
   {
-    SetOvershootEnabled(true);
-    mOvershootEnabled = true;
+    if( !mOvershootEnabled )
+    {
+      SetOvershootEnabled(true);
+      mOvershootEnabled = true;
+    }
     return;
   }
   if( mComponents.find(type) == mComponents.end() )
@@ -119,10 +122,13 @@ void Scrollable::EnableScrollComponent(Toolkit::Scrollable::ScrollComponentType
 
 void Scrollable::DisableScrollComponent(Toolkit::Scrollable::ScrollComponentType type)
 {
-  if(type == Toolkit::Scrollable::OvershootIndicator && mOvershootEnabled)
+  if(type == Toolkit::Scrollable::OvershootIndicator)
   {
-    SetOvershootEnabled(false);
-    mOvershootEnabled = false;
+    if( mOvershootEnabled )
+    {
+      SetOvershootEnabled(false);
+      mOvershootEnabled = false;
+    }
     return;
   }
   ComponentIter pair = mComponents.find( type );