[NUI] Remove redundant DALi object reference check code
authorJiyun Yang <ji.yang@samsung.com>
Sun, 12 Sep 2021 13:40:18 +0000 (22:40 +0900)
committerdongsug-song <35130733+dongsug-song@users.noreply.github.com>
Mon, 27 Sep 2021 08:27:23 +0000 (17:27 +0900)
Signed-off-by: Jiyun Yang <ji.yang@samsung.com>
src/Tizen.NUI/src/internal/Application/Application.cs
src/Tizen.NUI/src/internal/Common/ViewImpl.cs
src/Tizen.NUI/src/internal/Common/ViewWrapperImpl.cs
src/Tizen.NUI/src/internal/FrameBroker/DefaultFrameBroker.cs
src/Tizen.NUI/src/public/BaseComponents/ViewPublicMethods.cs
src/Tizen.NUI/src/public/Input/FocusManager.cs
src/Tizen.NUI/src/public/Layouting/LayoutGroup.cs

index 6a3e727..b154b26 100755 (executable)
@@ -1030,7 +1030,7 @@ namespace Tizen.NUI
         {
             // register all Views with the type registry, so that can be created / styled via JSON
             //ViewRegistryHelper.Initialize(); //moved to Application side.
-            if (instance)
+            if (instance != null)
             {
                 return instance;
             }
@@ -1045,7 +1045,7 @@ namespace Tizen.NUI
 
         public static Application NewApplication(string stylesheet, NUIApplication.WindowMode windowMode, Rectangle positionSize)
         {
-            if (instance)
+            if (instance != null)
             {
                 return instance;
             }
@@ -1059,7 +1059,7 @@ namespace Tizen.NUI
 
         public static Application NewApplication(string[] args, string stylesheet, NUIApplication.WindowMode windowMode)
         {
-            if (instance)
+            if (instance != null)
             {
                 return instance;
             }
@@ -1073,7 +1073,7 @@ namespace Tizen.NUI
 
         public static Application NewApplication(string[] args, string stylesheet, NUIApplication.WindowMode windowMode, Rectangle positionSize)
         {
-            if (instance)
+            if (instance != null)
             {
                 return instance;
             }
@@ -1087,7 +1087,7 @@ namespace Tizen.NUI
 
         public static Application NewApplication(string stylesheet, NUIApplication.WindowMode windowMode, WindowType type)
         {
-            if (instance)
+            if (instance != null)
             {
                 return instance;
             }
@@ -1298,7 +1298,7 @@ namespace Tizen.NUI
             {
                 Window currWin = Registry.GetManagedBaseHandleFromNativePtr(Interop.Application.GetWindowsFromList(i)) as Window;
                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-                if (currWin)
+                if (currWin != null)
                 {
                     WindowList.Add(currWin);
                 }
index f13d678..498c88f 100755 (executable)
@@ -598,7 +598,7 @@ namespace Tizen.NUI
         {
             View view = Registry.GetManagedBaseHandleFromNativePtr(child) as View;
 
-            if (view)
+            if (view != null)
             {
                 OnChildAdd(view);
             }
@@ -608,7 +608,7 @@ namespace Tizen.NUI
         {
             View view = Registry.GetManagedBaseHandleFromNativePtr(child) as View;
 
-            if (view)
+            if (view != null)
             {
                 OnChildRemove(view);
             }
@@ -652,7 +652,7 @@ namespace Tizen.NUI
         private float SwigDirectorCalculateChildSize(global::System.IntPtr child, int dimension)
         {
             View view = Registry.GetManagedBaseHandleFromNativePtr(child) as View;
-            if (view)
+            if (view != null)
             {
                 return CalculateChildSize(view, (DimensionType)dimension);
             }
@@ -697,7 +697,7 @@ namespace Tizen.NUI
         private void SwigDirectorOnStyleChange(global::System.IntPtr styleManager, int change)
         {
             StyleManager stManager = Registry.GetManagedBaseHandleFromNativePtr(styleManager) as StyleManager;
-            if (stManager)
+            if (stManager != null)
             {
                 OnStyleChange(stManager, (StyleChangeType)change);
             }
index 6517f00..6331465 100755 (executable)
@@ -358,7 +358,7 @@ namespace Tizen.NUI
         private void DirectorOnChildAdd(global::System.IntPtr child)
         {
             View view = Registry.GetManagedBaseHandleFromNativePtr(child) as View;
-            if (view)
+            if (view != null)
             {
                 OnChildAdd?.Invoke(view);
             }
@@ -367,7 +367,7 @@ namespace Tizen.NUI
         private void DirectorOnChildRemove(global::System.IntPtr child)
         {
             View view = Registry.GetManagedBaseHandleFromNativePtr(child) as View;
-            if (view)
+            if (view != null)
             {
                 OnChildRemove?.Invoke(view);
             }
@@ -426,7 +426,7 @@ namespace Tizen.NUI
         private float DirectorCalculateChildSize(global::System.IntPtr child, int dimension)
         {
             View view = Registry.GetManagedBaseHandleFromNativePtr(child) as View;
-            if (view)
+            if (view != null)
             {
                 return CalculateChildSize?.Invoke(view, (DimensionType)dimension) ?? 0.0f;
             }
index 1665e1b..8d7d64b 100755 (executable)
@@ -88,7 +88,7 @@ namespace Tizen.NUI
                     providerImage.PivotPoint = transition.DefaultImageStyle.PivotPoint;
                     providerImage.PositionUsesPivotPoint = true;
                     providerImage.AddRenderer(GetRenderer(frame));
-                    if (mainView)
+                    if (mainView != null)
                     {
                         mainView.Add(providerImage);
                         providerImage.LowerToBottom();
index 9486e32..3bfc5a5 100755 (executable)
@@ -236,11 +236,7 @@ namespace Tizen.NUI.BaseComponents
         /// <since_tizen> 4 </since_tizen>
         public override Container GetParent()
         {
-            if (InternalParent)
-            {
-                return this.InternalParent as Container;
-            }
-            return null;
+            return InternalParent as Container;
         }
 
         /// <summary>
index 016b311..de36c9e 100755 (executable)
@@ -522,7 +522,7 @@ namespace Tizen.NUI
             }
             else
             {
-                if (e.ProposedView) return proposed;
+                if (e.ProposedView != null) return proposed;
                 else return current;
             }
         }
index d2ddb28..9750ec8 100755 (executable)
@@ -456,7 +456,7 @@ namespace Tizen.NUI
 
                     View owner = Owner;
 
-                    if (owner)
+                    if (owner != null)
                     {
                         // Margin and Padding only supported when child anchor point is TOP_LEFT.
                         if (owner.PivotPoint == PivotPoint.TopLeft || (owner.PositionUsesPivotPoint == false))