From: huiyu.eun Date: Fri, 27 Nov 2020 00:53:59 +0000 (+0900) Subject: [NUI] Delete unnecessary log X-Git-Tag: submit/tizen_6.0/20201127.133124~1^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=72f55a572e765c6c5dcf8199434b119a57bb29ca;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git [NUI] Delete unnecessary log - Delete the log commented - Displays only one log when the value is invalid of color. - View.Parent is deprecated, modify to use View.GetParent() Signed-off-by: huiyu.eun --- diff --git a/src/Tizen.NUI/src/internal/Interop/Interop.Stage.cs b/src/Tizen.NUI/src/internal/Interop/Interop.Stage.cs index 49368dc40..0fac84660 100755 --- a/src/Tizen.NUI/src/internal/Interop/Interop.Stage.cs +++ b/src/Tizen.NUI/src/internal/Interop/Interop.Stage.cs @@ -10,8 +10,6 @@ namespace Tizen.NUI { static Stage() { - ulong ret = Interop.Util.GetNanoSeconds(); - Tizen.Log.Error("NUI", "Stage : " + ret); } [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Stage_DEFAULT_BACKGROUND_COLOR_get")] diff --git a/src/Tizen.NUI/src/internal/Interop/Interop.Util.cs b/src/Tizen.NUI/src/internal/Interop/Interop.Util.cs deleted file mode 100755 index ff8ce4eeb..000000000 --- a/src/Tizen.NUI/src/internal/Interop/Interop.Util.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace Tizen.NUI -{ - - internal static partial class Interop - { - internal static partial class Util - { - internal static ulong GetNanoSeconds() - { - return 0; - } - } - } -} \ No newline at end of file diff --git a/src/Tizen.NUI/src/internal/Interop/NDalicPINVOKE.cs b/src/Tizen.NUI/src/internal/Interop/NDalicPINVOKE.cs index 82b197ebe..7249f4f41 100755 --- a/src/Tizen.NUI/src/internal/Interop/NDalicPINVOKE.cs +++ b/src/Tizen.NUI/src/internal/Interop/NDalicPINVOKE.cs @@ -224,7 +224,6 @@ namespace Tizen.NUI static protected SWIGStringHelper swigStringHelper = new SWIGStringHelper(); static NDalicPINVOKE() { - Tizen.Log.Error("NUI", "Create NDalicPINVOKE"); } [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_delete_BaseHandle")] diff --git a/src/Tizen.NUI/src/public/Color.cs b/src/Tizen.NUI/src/public/Color.cs index 11ba75cf9..d6d1326c2 100755 --- a/src/Tizen.NUI/src/public/Color.cs +++ b/src/Tizen.NUI/src/public/Color.cs @@ -489,45 +489,9 @@ namespace Tizen.NUI float b = color.B; float a = color.A; - if (r < 0.0f) + if (IsInvalidValue(ref r) | IsInvalidValue(ref g) | IsInvalidValue(ref b) | IsInvalidValue(ref a)) { - r = 0.0f; - NUILog.Error("The value of Result is invalid! Should be between [0, 1]."); - } - else if (r > 1.0f) - { - r = 1.0f; - NUILog.Error("The value of Result is invalid! Should be between [0, 1]."); - } - if (g < 0.0f) - { - g = 0.0f; - NUILog.Error("The value of Result is invalid! Should be between [0, 1]."); - } - else if (g > 1.0f) - { - g = 1.0f; - NUILog.Error("The value of Result is invalid! Should be between [0, 1]."); - } - if (b < 0.0f) - { - b = 0.0f; - NUILog.Error("The value of Result is invalid! Should be between [0, 1]."); - } - else if (b > 1.0f) - { - b = 1.0f; - NUILog.Error("The value of Result is invalid! Should be between [0, 1]."); - } - if (a < 0.0f) - { - a = 0.0f; - NUILog.Error("The value of Result is invalid! Should be between [0, 1]."); - } - else if (a > 1.0f) - { - a = 1.0f; - NUILog.Error("The value of Result is invalid! Should be between [0, 1]."); + NUILog.Error($"The value of Result is invalid! Should be between [0, 1]. Color is {color.R}, {color.G}, {color.B}, {color.A}"); } color = new Color(r, g, b, a); return color; @@ -535,37 +499,43 @@ namespace Tizen.NUI internal static float ValueCheck(float value) { - if (value < 0.0f) + float refValue = value; + if (IsInvalidValue(ref refValue)) { - value = 0.0f; - NUILog.Error("The value of Parameters is invalid! Should be between [0, 1]."); + NUILog.Error($"The value of Result is invalid! Should be between [0, 1]. float value is {value}"); } - else if (value > 1.0f) - { - value = 1.0f; - NUILog.Error("The value of Parameters is invalid! Should be between [0, 1]."); - } - return value; + return refValue; } internal static float[] ValueCheck(float[] arr) { for (int i = 0; i < arr.Length; i++) { - if (arr[i] < 0.0f) + float refValue = arr[i]; + if (IsInvalidValue(ref refValue)) { - arr[i] = 0.0f; - NUILog.Error("The value of Parameters is invalid! Should be between [0, 1]."); - } - else if (arr[i] > 1.0f) - { - arr[i] = 1.0f; - NUILog.Error("The value of Parameters is invalid! Should be between [0, 1]."); + NUILog.Error($"The value of Result is invalid! Should be between [0, 1]. arr[] is {arr[i]}"); + arr[i] = refValue; } } return arr; } + private static bool IsInvalidValue(ref float value) + { + if (value < 0.0f) + { + value = 0.0f; + return true; + } + else if (value > 1.0f) + { + value = 1.0f; + return true; + } + return false; + } + /// This will not be public opened. [EditorBrowsable(EditorBrowsableState.Never)] protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr) diff --git a/src/Tizen.NUI/src/public/Layouting/LayoutGroup.cs b/src/Tizen.NUI/src/public/Layouting/LayoutGroup.cs index fe85c93a8..974197f21 100755 --- a/src/Tizen.NUI/src/public/Layouting/LayoutGroup.cs +++ b/src/Tizen.NUI/src/public/Layouting/LayoutGroup.cs @@ -133,9 +133,10 @@ namespace Tizen.NUI [EditorBrowsable(EditorBrowsableState.Never)] public void ChangeLayoutSiblingOrder(int order) { - if(Owner != null && Owner.Parent != null) + var ownerParent = Owner.GetParent() as View; + if (Owner != null && ownerParent != null) { - LayoutGroup parent = Owner.Parent.Layout as LayoutGroup; + var parent = ownerParent.Layout as LayoutGroup; if(parent != null && parent.LayoutChildren.Count>order) { diff --git a/src/Tizen.NUI/src/public/Layouting/LayoutItem.cs b/src/Tizen.NUI/src/public/Layouting/LayoutItem.cs index 17aa496ca..1c7c2c26c 100755 --- a/src/Tizen.NUI/src/public/Layouting/LayoutItem.cs +++ b/src/Tizen.NUI/src/public/Layouting/LayoutItem.cs @@ -552,7 +552,8 @@ namespace Tizen.NUI " right:" + _layoutPositionData.Right + " bottom:" + _layoutPositionData.Bottom ); - if (Owner.Parent != null && Owner.Parent.Layout != null && Owner.Parent.Layout.LayoutWithTransition) + var ownerParent = Owner.GetParent() as View; + if (ownerParent != null && ownerParent.Layout != null && ownerParent.Layout.LayoutWithTransition) { NUIApplication.GetDefaultWindow().LayoutController.AddTransitionDataEntry(_layoutPositionData); } diff --git a/src/Tizen.NUI/src/public/PropertyValue.cs b/src/Tizen.NUI/src/public/PropertyValue.cs index b0ea75d47..3c2d44019 100755 --- a/src/Tizen.NUI/src/public/PropertyValue.cs +++ b/src/Tizen.NUI/src/public/PropertyValue.cs @@ -339,7 +339,6 @@ namespace Tizen.NUI { throw new global::System.InvalidOperationException("Unimplemented type for Property Value :" + type.Name); } - //NUILog.Debug(" got an property value of =" + type.Name); return value; } diff --git a/src/Tizen.NUI/src/public/WindowEvent.cs b/src/Tizen.NUI/src/public/WindowEvent.cs index 8d373f57e..e39beeca3 100755 --- a/src/Tizen.NUI/src/public/WindowEvent.cs +++ b/src/Tizen.NUI/src/public/WindowEvent.cs @@ -565,13 +565,11 @@ namespace Tizen.NUI private WindowTransitionEffectSignal TransitionEffectEventSignal() { - //Tizen.Log.Fatal("NUITEST", "TransitionEffectEventSignal()!"); if (transitionEffectSignal == null) { transitionEffectSignal = new WindowTransitionEffectSignal(this); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - //Tizen.Log.Fatal("NUITEST", $"transitionEffectSignal is null, new here!"); } return transitionEffectSignal; } @@ -737,24 +735,19 @@ namespace Tizen.NUI private void OnTransitionEffect(IntPtr window, int state, int type) { - //Tizen.Log.Fatal("NUITEST", $"OnTransitionEffect() called"); if (window == global::System.IntPtr.Zero) { - //Tizen.Log.Error("NUI", $"OnTransitionEffect() IntPtr window is null!"); return; } TransitionEffectArgs e = new TransitionEffectArgs(); e.State = (EffectStates)state; - //Tizen.Log.Error("NUITEST", $"e.State={e.State}"); e.Type = (EffectTypes)type; - //Tizen.Log.Error("NUITEST", $"e.Type={e.Type}"); if (transitionEffectHandler != null) { - //Tizen.Log.Fatal("NUITEST", $"Execute transitionEffectHandler(this, e)!!!"); transitionEffectHandler(this, e); } return;