(prevnet) Fix prevnet issues 58/19958/1
authorKingsley Stephens <k.stephens@partner.samsung.com>
Tue, 22 Apr 2014 15:08:58 +0000 (16:08 +0100)
committerAndrew Cox <andrew.cox@partner.samsung.com>
Wed, 23 Apr 2014 18:43:20 +0000 (19:43 +0100)
[Issue#]  N/A

[Problem] Prevnet identified some issues needing fixing

[Cause]   N/A

[Solution] Adjust code to satisfy prevnet

Change-Id: I501e0f51eaeee823cc428fce0edb6c0b2de27bea
Signed-off-by: Andrew Cox <andrew.cox@partner.samsung.com>
dali/internal/event/common/property-notification-impl.cpp
dali/internal/event/images/image-impl.cpp
dali/internal/event/modeling/animatable-mesh-impl.cpp

index 734c4c4..57c5239 100644 (file)
@@ -89,31 +89,30 @@ PropertyNotification::PropertyNotification(UpdateManager& updateManager,
 
   // Observe target proxy and create/destroy notification scene object accordingly.
   mProxy = dynamic_cast<ProxyObject*>( &GetImplementation(target.object) );
-  mPropertyType = mProxy->GetPropertyType(mProxyPropertyIndex);
-
-  int internalComponentIndex = mProxy->GetPropertyComponentIndex(mProxyPropertyIndex);
-  if( internalComponentIndex != Property::INVALID_COMPONENT_INDEX )
-  {
-    // override the one passed in
-    mComponentIndex = internalComponentIndex;
-  }
-  if(mComponentIndex != Property::INVALID_COMPONENT_INDEX)
+  if ( mProxy )
   {
-    Property::Type type = mProxy->GetPropertyType(mProxyPropertyIndex);
-    if( type == Property::VECTOR2
-        || type == Property::VECTOR3
-        || type == Property::VECTOR4 )
+    mPropertyType = mProxy->GetPropertyType(mProxyPropertyIndex);
+
+    int internalComponentIndex = mProxy->GetPropertyComponentIndex(mProxyPropertyIndex);
+    if( internalComponentIndex != Property::INVALID_COMPONENT_INDEX )
     {
-      mPropertyType = Property::FLOAT;
+      // override the one passed in
+      mComponentIndex = internalComponentIndex;
+    }
+    if(mComponentIndex != Property::INVALID_COMPONENT_INDEX)
+    {
+      Property::Type type = mProxy->GetPropertyType(mProxyPropertyIndex);
+      if( type == Property::VECTOR2
+          || type == Property::VECTOR3
+          || type == Property::VECTOR4 )
+      {
+        mPropertyType = Property::FLOAT;
+      }
     }
-  }
 
-  // Check if target scene-object already present, and if so create our notification
-  // scene-object
-  if ( mProxy )
-  {
+    // Check if target scene-object already present, and if so create our notification
+    // scene-object
     const SceneGraph::PropertyOwner* object = mProxy->GetSceneObject();
-
     if (object)
     {
       CreateSceneObject();
index 156f364..c96a87e 100644 (file)
@@ -305,7 +305,7 @@ bool Image::IsNinePatchFileName( std::string filename )
 
   std::string::const_reverse_iterator iter = filename.rbegin();
   enum { SUFFIX, HASH, HASH_DOT, DONE } state = SUFFIX;
-  while(iter < filename.rend() && state != DONE)
+  while(iter < filename.rend())
   {
     switch(state)
     {
@@ -347,6 +347,13 @@ bool Image::IsNinePatchFileName( std::string filename )
       }
       break;
     }
+
+    // Satisfy prevnet
+    if( state == DONE )
+    {
+      break;
+    }
+
     iter++;
   }
   return match;
index 762689e..afab49b 100644 (file)
@@ -306,11 +306,6 @@ void AnimatableMesh::SetDefaultProperty( Property::Index index, const Property::
       SetTextureCoords( vertexIndex, property.Get<Vector2>() );
       break;
     }
-    default:
-    {
-      DALI_ASSERT_ALWAYS(false && "AnimatableMesh property index out of range"); // should not come here
-      break;
-    }
   }
 }
 
@@ -342,11 +337,6 @@ Property::Value AnimatableMesh::GetDefaultProperty(Property::Index index) const
       value = GetCurrentTextureCoords(vertexIndex);
       break;
     }
-    default:
-    {
-      DALI_ASSERT_ALWAYS(false && "AnimatableMesh property index out of range"); // should not come here
-      break;
-    }
   }
 
   return value;
@@ -385,10 +375,6 @@ const SceneGraph::PropertyBase* AnimatableMesh::GetSceneObjectAnimatableProperty
       case Dali::AnimatableVertex::TEXTURE_COORDS:
         property = &mSceneObject->mVertices[vertexIndex].textureCoords;
         break;
-
-      default:
-        DALI_ASSERT_DEBUG( 0 && "Index out of bounds" );
-        break;
     }
   }
 
@@ -414,9 +400,6 @@ const PropertyInputImpl* AnimatableMesh::GetSceneObjectInputProperty( Property::
       case Dali::AnimatableVertex::TEXTURE_COORDS:
         property = &mSceneObject->mVertices[vertexIndex].textureCoords;
         break;
-
-      default:
-        break;
     }
   }