[NUI] Fixed svace issue for API8
authorzhouleonlei <zhouleon.lei@samsung.com>
Wed, 9 Dec 2020 03:09:10 +0000 (11:09 +0800)
committerdongsug-song <35130733+dongsug-song@users.noreply.github.com>
Wed, 9 Dec 2020 04:20:01 +0000 (13:20 +0900)
src/Tizen.NUI/src/internal/PropertyRangeManager.cs
src/Tizen.NUI/src/public/Layouting/LayoutGroup.cs

index 894727d..a0168b4 100755 (executable)
@@ -92,13 +92,16 @@ namespace Tizen.NUI
             // we add 1000, just incase View class starts using animatable properties
             int startAnimatablePropertyIndex = (int)Tizen.NUI.PropertyRanges.ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX + maxCountPerDerivation;
 
-            while (viewType.GetTypeInfo().BaseType?.Name != "CustomView")   // custom view is our C# view base class. we don't go any deeper.
+            if (viewType != null)
             {
-                // for every base class increase property start index
-                startEventPropertyIndex += (int)Tizen.NUI.PropertyRanges.DEFAULT_PROPERTY_MAX_COUNT_PER_DERIVATION; // DALi uses 10,000
-                startAnimatablePropertyIndex += maxCountPerDerivation;
-                NUILog.Debug("getStartPropertyIndex =  " + viewType.Name + "current index " + startEventPropertyIndex);
-                viewType = viewType.GetTypeInfo().BaseType;
+                while (viewType.GetTypeInfo().BaseType?.Name != "CustomView")   // custom view is our C# view base class. we don't go any deeper.
+                {
+                    // for every base class increase property start index
+                    startEventPropertyIndex += (int)Tizen.NUI.PropertyRanges.DEFAULT_PROPERTY_MAX_COUNT_PER_DERIVATION; // DALi uses 10,000
+                    startAnimatablePropertyIndex += maxCountPerDerivation;
+                    NUILog.Debug("getStartPropertyIndex =  " + viewType.Name + "current index " + startEventPropertyIndex);
+                    viewType = viewType.GetTypeInfo().BaseType;
+                }
             }
 
             range.startEventIndex = startEventPropertyIndex;
index 974197f..f156cb4 100755 (executable)
@@ -133,18 +133,20 @@ namespace Tizen.NUI
         [EditorBrowsable(EditorBrowsableState.Never)]
         public void ChangeLayoutSiblingOrder(int order)
         {
-            var ownerParent = Owner.GetParent() as View;
-            if (Owner != null && ownerParent != null)
+            if (Owner != null)
             {
-                var parent = ownerParent.Layout as LayoutGroup;
-
-                if(parent != null && parent.LayoutChildren.Count>order)
+                var ownerParent = Owner.GetParent() as View;
+                if (ownerParent != null)
                 {
-                    parent.LayoutChildren.Remove(this);
-                    parent.LayoutChildren.Insert(order,this);
+                    var parent = ownerParent.Layout as LayoutGroup;
+
+                    if (parent != null && parent.LayoutChildren.Count > order)
+                    {
+                        parent.LayoutChildren.Remove(this);
+                        parent.LayoutChildren.Insert(order, this);
+                    }
                 }
             }
-
             RequestLayout();
         }