From 1f1a09e460ca5556c2c7ad4f8456c873d7e89f61 Mon Sep 17 00:00:00 2001 From: dongsug-song <35130733+dongsug-song@users.noreply.github.com> Date: Fri, 7 Aug 2020 10:54:43 +0900 Subject: [PATCH] [NUI] Remove workaround, Fix PropertyMap().Add() problem (#1899) --- src/Tizen.NUI/src/public/PropertyMap.cs | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/src/Tizen.NUI/src/public/PropertyMap.cs b/src/Tizen.NUI/src/public/PropertyMap.cs index 24d133b..a34f4b7 100755 --- a/src/Tizen.NUI/src/public/PropertyMap.cs +++ b/src/Tizen.NUI/src/public/PropertyMap.cs @@ -32,10 +32,6 @@ namespace Tizen.NUI public PropertyMap() : this(Interop.PropertyMap.new_Property_Map__SWIG_0(), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - - // workaround : when do "new PropertyMap().Add(xxx, xxx).Add(xxx, xxx)", it has garbage values sometimes. - // this will be fixed later. - Clear(); } /// @@ -150,9 +146,9 @@ namespace Tizen.NUI /// 3 public PropertyMap Add(string key, PropertyValue value) { - PropertyMap ret = new PropertyMap(Interop.PropertyMap.Property_Map_Add__SWIG_0(swigCPtr, key, PropertyValue.getCPtr(value)), false); + Interop.PropertyMap.Property_Map_Add__SWIG_0(swigCPtr, key, PropertyValue.getCPtr(value)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + return this; } /// @@ -165,9 +161,9 @@ namespace Tizen.NUI /// 3 public PropertyMap Add(int key, PropertyValue value) { - PropertyMap ret = new PropertyMap(Interop.PropertyMap.Property_Map_Add__SWIG_2(swigCPtr, key, PropertyValue.getCPtr(value)), false); + Interop.PropertyMap.Property_Map_Add__SWIG_2(swigCPtr, key, PropertyValue.getCPtr(value)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + return this; } /// @@ -178,18 +174,17 @@ namespace Tizen.NUI /// Returns a reference to this object. public PropertyMap Add(KeyValue keyValue) { - PropertyMap ret = new PropertyMap(); - if ( keyValue.KeyInt != null ) + if (keyValue.KeyInt != null) { - ret = new PropertyMap(Interop.PropertyMap.Property_Map_Add__SWIG_2(swigCPtr, (int)keyValue.KeyInt, PropertyValue.getCPtr(keyValue.TrueValue)), false); + Interop.PropertyMap.Property_Map_Add__SWIG_2(swigCPtr, (int)keyValue.KeyInt, PropertyValue.getCPtr(keyValue.TrueValue)); } - else if ( keyValue.KeyString != null ) + else if (keyValue.KeyString != null) { - ret = new PropertyMap(Interop.PropertyMap.Property_Map_Add__SWIG_0(swigCPtr, keyValue.KeyString, PropertyValue.getCPtr(keyValue.TrueValue)), false); + Interop.PropertyMap.Property_Map_Add__SWIG_0(swigCPtr, keyValue.KeyString, PropertyValue.getCPtr(keyValue.TrueValue)); } if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + return this; } /// -- 2.7.4