[dali_2.3.24] Merge branch 'devel/master'
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / controls / tooltip / tooltip.cpp
index e8274d1..687d3ef 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 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.
@@ -148,12 +148,12 @@ void Tooltip::CreatePropertyMap(Property::Map& map) const
   if(!mContentTextVisual.Empty())
   {
     Property::Map content = mContentTextVisual; // Need this copy as there's no Value constructor which takes in a 'const Property::Map&'.
-    map.Insert(Toolkit::Tooltip::Property::CONTENT, content);
+    map.Insert(Toolkit::Tooltip::Property::CONTENT, std::move(content));
   }
   else if(!mContentArray.Empty())
   {
     Property::Array content = mContentArray; // Need this copy as there's no Value constructor which takes in a 'const Property::Array&'.
-    map.Insert(Toolkit::Tooltip::Property::CONTENT, content);
+    map.Insert(Toolkit::Tooltip::Property::CONTENT, std::move(content));
   }
 
   map.Insert(Toolkit::Tooltip::Property::LAYOUT, mLayout);
@@ -289,8 +289,10 @@ void Tooltip::SetBackground(const Property::Value& value)
 
   if(type == Property::STRING)
   {
-    value.Get(mBackgroundImage);
-    mBackgroundBorder.Set(0, 0, 0, 0);
+    if(DALI_LIKELY(value.Get(mBackgroundImage)))
+    {
+      mBackgroundBorder.Set(0, 0, 0, 0);
+    }
   }
   else if(type == Property::MAP)
   {