From: dongsug-song <35130733+dongsug-song@users.noreply.github.com> Date: Fri, 7 Aug 2020 01:54:43 +0000 (+0900) Subject: [NUI] Remove workaround, Fix PropertyMap().Add() problem (#1899) X-Git-Tag: accepted/tizen/unified/20210219.040944~506 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1f1a09e460ca5556c2c7ad4f8456c873d7e89f61;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git [NUI] Remove workaround, Fix PropertyMap().Add() problem (#1899) --- 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; } ///