[dali_2.3.27] Merge branch 'devel/master'
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / controls / popup / popup-impl.cpp
index f7ebcf4..9c9a1f2 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
@@ -343,8 +343,6 @@ void Popup::OnInitialize()
 
   SetupTouch();
 
-  DevelControl::AppendAccessibilityAttribute(Toolkit::Control::DownCast(self), "sub-role", "Alert");
-
   self.SetProperty(DevelControl::Property::ACCESSIBILITY_ROLE, Dali::Accessibility::Role::DIALOG);
 }
 
@@ -989,7 +987,7 @@ void Popup::SetTailVisibility(bool visible)
   mLayoutDirty = true;
 }
 
-const bool Popup::IsTailVisible() const
+bool Popup::IsTailVisible() const
 {
   return mTailVisible;
 }
@@ -1067,7 +1065,7 @@ void Popup::SetBackingEnabled(bool enabled)
   mLayoutDirty    = true;
 }
 
-const bool Popup::IsBackingEnabled() const
+bool Popup::IsBackingEnabled() const
 {
   return mBackingEnabled;
 }
@@ -1086,7 +1084,7 @@ const Vector4& Popup::GetBackingColor() const
 
 void Popup::SetTailUpImage(std::string image)
 {
-  mTailUpImage = image;
+  mTailUpImage = std::move(image);
   mLayoutDirty = true;
   LayoutTail();
 }
@@ -1098,7 +1096,7 @@ const std::string& Popup::GetTailUpImage() const
 
 void Popup::SetTailDownImage(std::string image)
 {
-  mTailDownImage = image;
+  mTailDownImage = std::move(image);
   mLayoutDirty   = true;
   LayoutTail();
 }
@@ -1110,7 +1108,7 @@ const std::string& Popup::GetTailDownImage() const
 
 void Popup::SetTailLeftImage(std::string image)
 {
-  mTailLeftImage = image;
+  mTailLeftImage = std::move(image);
   mLayoutDirty   = true;
   LayoutTail();
 }
@@ -1122,7 +1120,7 @@ const std::string& Popup::GetTailLeftImage() const
 
 void Popup::SetTailRightImage(std::string image)
 {
-  mTailRightImage = image;
+  mTailRightImage = std::move(image);
   mLayoutDirty    = true;
   LayoutTail();
 }
@@ -1141,7 +1139,7 @@ void Popup::SetTouchTransparent(bool enabled)
   }
 }
 
-const bool Popup::IsTouchTransparent() const
+bool Popup::IsTouchTransparent() const
 {
   return mTouchTransparent;
 }
@@ -1308,7 +1306,7 @@ void Popup::SetProperty(BaseObject* object, Property::Index propertyIndex, const
         std::string valueString;
         if(value.Get(valueString))
         {
-          Toolkit::ImageView actor = Toolkit::ImageView::New(valueString);
+          Toolkit::ImageView actor = Toolkit::ImageView::New(std::move(valueString));
           popupImpl.SetPopupBackgroundImage(actor);
         }
         break;
@@ -1343,7 +1341,7 @@ void Popup::SetProperty(BaseObject* object, Property::Index propertyIndex, const
         std::string valueString;
         if(value.Get(valueString))
         {
-          popupImpl.SetTailUpImage(valueString);
+          popupImpl.SetTailUpImage(std::move(valueString));
         }
         break;
       }
@@ -1352,7 +1350,7 @@ void Popup::SetProperty(BaseObject* object, Property::Index propertyIndex, const
         std::string valueString;
         if(value.Get(valueString))
         {
-          popupImpl.SetTailDownImage(valueString);
+          popupImpl.SetTailDownImage(std::move(valueString));
         }
         break;
       }
@@ -1361,7 +1359,7 @@ void Popup::SetProperty(BaseObject* object, Property::Index propertyIndex, const
         std::string valueString;
         if(value.Get(valueString))
         {
-          popupImpl.SetTailLeftImage(valueString);
+          popupImpl.SetTailLeftImage(std::move(valueString));
         }
         break;
       }
@@ -1370,7 +1368,7 @@ void Popup::SetProperty(BaseObject* object, Property::Index propertyIndex, const
         std::string valueString;
         if(value.Get(valueString))
         {
-          popupImpl.SetTailRightImage(valueString);
+          popupImpl.SetTailRightImage(std::move(valueString));
         }
         break;
       }
@@ -1394,21 +1392,21 @@ Property::Value Popup::GetProperty(BaseObject* object, Property::Index propertyI
       {
         Property::Map map;
         Scripting::CreatePropertyMap(popupImpl.GetTitle(), map);
-        value = map;
+        value = std::move(map);
         break;
       }
       case Toolkit::Popup::Property::CONTENT:
       {
         Property::Map map;
         Scripting::CreatePropertyMap(popupImpl.GetContent(), map);
-        value = map;
+        value = std::move(map);
         break;
       }
       case Toolkit::Popup::Property::FOOTER:
       {
         Property::Map map;
         Scripting::CreatePropertyMap(popupImpl.GetFooter(), map);
-        value = map;
+        value = std::move(map);
         break;
       }
       case Toolkit::Popup::Property::DISPLAY_STATE:
@@ -1450,14 +1448,14 @@ Property::Value Popup::GetProperty(BaseObject* object, Property::Index propertyI
       {
         // Note: Cannot retrieve property map from animation.
         Property::Map map;
-        value = map;
+        value = std::move(map);
         break;
       }
       case Toolkit::Popup::Property::EXIT_ANIMATION:
       {
         // Note: Cannot retrieve property map from animation.
         Property::Map map;
-        value = map;
+        value = std::move(map);
         break;
       }
       case Toolkit::Popup::Property::AUTO_HIDE_DELAY:
@@ -2005,7 +2003,7 @@ std::string Popup::PopupAccessible::GetNameRaw() const
   if(popupTitle)
   {
     std::string titleText = popupTitle.GetProperty<std::string>(Toolkit::TextLabel::Property::TEXT);
-    title                 = titleText;
+    title                 = std::move(titleText);
   }
   else
   {
@@ -2013,7 +2011,7 @@ std::string Popup::PopupAccessible::GetNameRaw() const
     if(popupContent)
     {
       std::string contentText = popupContent.GetProperty<std::string>(Toolkit::TextLabel::Property::TEXT);
-      title                   = contentText;
+      title                   = std::move(contentText);
     }
   }
   return title;