[dali_1.0.22] Merge branch 'tizen'
[platform/core/uifw/dali-core.git] / dali / internal / event / object / custom-object-internal.cpp
index bc889b8..4a0ae90 100644 (file)
@@ -1,18 +1,19 @@
-//
-// Copyright (c) 2014 Samsung Electronics Co., Ltd.
-//
-// Licensed under the Flora License, Version 1.0 (the License);
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://floralicense.org/license/
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an AS IS BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
 
 // CLASS HEADER
 #include <dali/internal/event/object/custom-object-internal.h>
@@ -30,11 +31,6 @@ using Dali::Internal::SceneGraph::PropertyBase;
 using Dali::Internal::SceneGraph::UpdateManager;
 using Dali::Internal::SceneGraph::AnimatableProperty;
 
-namespace
-{
-const std::string INVALID_PROPERTY_NAME;
-}
-
 namespace Dali
 {
 
@@ -58,15 +54,9 @@ const SceneGraph::PropertyOwner* CustomObject::GetSceneObject() const
 
 const PropertyBase* CustomObject::GetSceneObjectAnimatableProperty( Property::Index index ) const
 {
-  const PropertyBase* property( NULL );
-
-  CustomPropertyLookup::const_iterator entry = GetCustomPropertyLookup().find( index );
-
-  DALI_ASSERT_ALWAYS( GetCustomPropertyLookup().end() != entry && "index is invalid" );
-
-  property = dynamic_cast<const PropertyBase*>( entry->second.GetSceneGraphProperty() );
-
-  return property;
+  CustomProperty* custom = FindCustomProperty( index );
+  DALI_ASSERT_ALWAYS( custom && "Property index is invalid" );
+  return custom->GetSceneGraphProperty();;
 }
 
 const PropertyInputImpl* CustomObject::GetSceneObjectInputProperty( Property::Index index ) const
@@ -83,9 +73,9 @@ void CustomObject::GetDefaultPropertyIndices( Property::IndexContainer& indices
 {
 }
 
-const std::string& CustomObject::GetDefaultPropertyName( Property::Index index ) const
+const char* CustomObject::GetDefaultPropertyName( Property::Index index ) const
 {
-  return INVALID_PROPERTY_NAME;
+  return NULL;
 }
 
 Property::Index CustomObject::GetDefaultPropertyIndex(const std::string& name) const