Removed unnecessary try-catch from Control base class 59/194459/2
authorKimmo Hoikka <kimmo.hoikka@samsung.com>
Tue, 4 Dec 2018 17:41:39 +0000 (17:41 +0000)
committerKimmo Hoikka <kimmo.hoikka@samsung.com>
Wed, 5 Dec 2018 16:35:35 +0000 (16:35 +0000)
- GetPropertyName used to ASSERT_ALWAYS but now just does a LOG_ERROR

Change-Id: I72a216000e233ec4d83b90019d3bc2ac777d7497

dali-toolkit/internal/controls/control/control-data-impl.cpp

index a8387ee..5e94e8f 100755 (executable)
@@ -477,19 +477,13 @@ void Control::Impl::RegisterVisual( Property::Index index, Toolkit::Visual::Base
   // ( If the control has been type registered )
   if( visual.GetName().empty() )
   {
-    try
+    // returns empty string if index is not found as long as index is not -1
+    std::string visualName = self.GetPropertyName( index );
+    if( !visualName.empty() )
     {
-      std::string visualName = self.GetPropertyName( index );
-      if( !visualName.empty() )
-      {
-        DALI_LOG_INFO( gLogFilter, Debug::Concise, "Setting visual name for property %d to %s\n",
-                       index, visualName.c_str() );
-        visual.SetName( visualName );
-      }
-    }
-    catch( Dali::DaliException e )
-    {
-      DALI_LOG_WARNING( "Attempting to register visual without a registered property, index: %d\n", index );
+      DALI_LOG_INFO( gLogFilter, Debug::Concise, "Setting visual name for property %d to %s\n",
+                     index, visualName.c_str() );
+      visual.SetName( visualName );
     }
   }