Object::GetPropertyType should return Property::NONE for non-existing child properties 95/70795/1
authorRichard Huang <r.huang@samsung.com>
Fri, 20 May 2016 14:17:42 +0000 (15:17 +0100)
committerRichard Huang <r.huang@samsung.com>
Fri, 20 May 2016 14:18:19 +0000 (15:18 +0100)
Change-Id: Ib1383338deaa369636fb4c2b5ae86a29d6386c97

automated-tests/src/dali/utc-Dali-TypeRegistry.cpp
dali/internal/event/common/object-impl.cpp

index 9f0acedd117bfb65f8369909d146ef5011ca4831..de9d773c948e80df2954b329f45c6362d730cd75 100644 (file)
@@ -1429,6 +1429,12 @@ int UtcDaliTypeRegistryChildPropertyRegistrationP(void)
   DALI_TEST_CHECK( childActor );
   unsigned int initialChildActorPropertyCount( childActor.GetPropertyCount() );
 
+  // The type of child properties should be Property::None as the child hasn't registered any child property yet.
+  DALI_TEST_EQUALS( childActor.GetPropertyType( propertyIndex ), Property::NONE, TEST_LOCATION );
+  DALI_TEST_EQUALS( childActor.GetPropertyType( propertyIndex2 ), Property::NONE, TEST_LOCATION );
+  DALI_TEST_EQUALS( childActor.GetPropertyType( propertyIndex3 ), Property::NONE, TEST_LOCATION );
+  DALI_TEST_EQUALS( childActor.GetPropertyType( propertyIndex4 ), Property::NONE, TEST_LOCATION );
+
   // Set the value for the first child property when the child actor doesn't have a parent yet
   childActor.SetProperty(propertyIndex, true);
 
index 329b8c80b60fc3c72a1a3df81173ddb0d2669619..b384b8b8b384434b8a549480a4c8a2916c18e8d3 100644 (file)
@@ -368,18 +368,6 @@ Property::Type Object::GetPropertyType( Property::Index index ) const
   {
     return custom->GetType();
   }
-  else if( index >= CHILD_PROPERTY_REGISTRATION_START_INDEX && index <= CHILD_PROPERTY_REGISTRATION_MAX_INDEX )
-  {
-    Object* parent = GetParentObject();
-    if( parent )
-    {
-      const TypeInfo* parentTypeInfo( parent->GetTypeInfo() );
-      if( parentTypeInfo )
-      {
-        return parentTypeInfo->GetChildPropertyType( index );
-      }
-    }
-  }
 
   return Property::NONE;
 }