From: dongsug-song <35130733+dongsug-song@users.noreply.github.com> Date: Mon, 25 Jun 2018 05:50:59 +0000 (+0900) Subject: [NUI] Fix crash error when setting LinearLayout's CellPadding (#311) X-Git-Tag: 5.0.0.14562~174 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9ca4cb8b230f221cc8e1691a43e4ee6e5a7ad95c;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git [NUI] Fix crash error when setting LinearLayout's CellPadding (#311) --- diff --git a/src/Tizen.NUI/src/internal/Layouting/LayoutSize.cs b/src/Tizen.NUI/src/internal/Layouting/LayoutSize.cs index d49921f..77c1a01 100755 --- a/src/Tizen.NUI/src/internal/Layouting/LayoutSize.cs +++ b/src/Tizen.NUI/src/internal/Layouting/LayoutSize.cs @@ -101,27 +101,40 @@ namespace Tizen.NUI /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static bool operator ==(LayoutSize r1, LayoutSize r2) + public bool IsEqualTo(LayoutSize target) { - return r1.EqualTo(r2); + if (this.Width == target.Width && this.Height == target.Height) + { + return true; + } + return false; } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public static bool operator !=(LayoutSize r1, LayoutSize r2) - { - return !r1.EqualTo(r2); - } + + // This causes crash! + // compile warning message : + //'LayoutSize' defines operator == or operator != but does not override Object.Equals(object o) + //'LayoutSize' defines operator == or operator != but does not override Object.GetHashCode() + //public static bool operator ==(LayoutSize r1, LayoutSize r2) + //{ + // return r1.EqualTo(r2); + //} + //public static bool operator !=(LayoutSize r1, LayoutSize r2) + //{ + // return !r1.EqualTo(r2); + //} + /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public int Width { - set - { - LayoutPINVOKE.LayoutSize_width_set(swigCPtr, value); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } + //This should be blocked! Otherwise, user can set multiple-cascading property setting like "LinearLayout.CellPadding.Width = 100;". This will not be working! + //set + //{ + // LayoutPINVOKE.LayoutSize_width_set(swigCPtr, value); + // if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + //} get { int ret = LayoutPINVOKE.LayoutSize_width_get(swigCPtr); @@ -134,11 +147,12 @@ namespace Tizen.NUI [EditorBrowsable(EditorBrowsableState.Never)] public int Height { - set - { - LayoutPINVOKE.LayoutSize_height_set(swigCPtr, value); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } + //This should be blocked! Otherwise, user can set multiple-cascading property setting like "LinearLayout.CellPadding.Height = 100;". This will not be working! + //set + //{ + // LayoutPINVOKE.LayoutSize_height_set(swigCPtr, value); + // if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + //} get { int ret = LayoutPINVOKE.LayoutSize_height_get(swigCPtr);