[NUI] Modify Svace issues
authorzhouleonlei <zhouleon.lei@samsung.com>
Fri, 13 Nov 2020 05:54:10 +0000 (13:54 +0800)
committerdongsug-song <35130733+dongsug-song@users.noreply.github.com>
Thu, 19 Nov 2020 07:53:18 +0000 (16:53 +0900)
src/Tizen.NUI.Components/Controls/DropDown.cs
src/Tizen.NUI/src/internal/EnumHelper.cs
src/Tizen.NUI/src/internal/Layouting/LayoutController.cs
src/Tizen.NUI/src/internal/XamlBinding/TemplateUtilities.cs
src/Tizen.NUI/src/public/NUIComponentApplication.cs
src/Tizen.NUI/src/public/Visuals/ColorVisual.cs
src/Tizen.NUI/src/public/Visuals/PrimitiveVisual.cs
src/Tizen.NUI/src/public/Visuals/VisualAnimator.cs
src/Tizen.NUI/src/public/XamlBinding/BindableObject.cs
src/Tizen.NUI/src/public/XamlBinding/Element.cs

index 745dccf..c827075 100755 (executable)
@@ -691,8 +691,10 @@ namespace Tizen.NUI.Components
                     data.IsSelected = false;
                 }
                 DropDownItemView listItemView = dropDownMenuFullList.GetChildAt((uint)selectedItemIndex) as DropDownItemView;
-
-                SetListItemToSelected(listItemView);
+                if (listItemView != null)
+                {
+                    SetListItemToSelected(listItemView);
+                }
             }
 
             if (index != -1)
@@ -833,12 +835,15 @@ namespace Tizen.NUI.Components
                 }
                 set
                 {
-                    if (null == itemDataStyle?.BackgroundColor)
+                    if (null != itemDataStyle)
                     {
-                        itemDataStyle.BackgroundColor = new Selector<Color>();
-                    }
+                        if (null == itemDataStyle.BackgroundColor)
+                        {
+                            itemDataStyle.BackgroundColor = new Selector<Color>();
+                        }
 
-                    itemDataStyle.BackgroundColor.Clone(value);
+                        itemDataStyle.BackgroundColor.Clone(value);
+                    }
                 }
             }
 
@@ -1476,7 +1481,6 @@ namespace Tizen.NUI.Components
                     return;
                 }
                 DropDownItemView listItemView = holder.ItemView as DropDownItemView;
-                listItemView.Name = "Item" + position;
                 if (listItemData.Size != null)
                 {
                     if (listItemData.Size.Width > 0)
@@ -1500,6 +1504,7 @@ namespace Tizen.NUI.Components
 
                 if (listItemView != null)
                 {
+                    listItemView.Name = "Item" + position;
                     listItemView.BackgroundColorSelector = listItemData.BackgroundColor;
                     if (listItemData.Text != null)
                     {
index 4e02d31..a87b6d5 100755 (executable)
@@ -38,7 +38,7 @@ namespace Tizen.NUI
             string result = value.ToString();
             FieldInfo info = typeof(T).GetField(result);
             var attributes = info.GetCustomAttributes(typeof(DescriptionAttribute), true);
-            if (null != attributes?.FirstOrDefault())
+            if (null != attributes?.FirstOrDefault() && null != (attributes.First() as DescriptionAttribute))
             {
                 result = (attributes.First() as DescriptionAttribute).Description;
             }
index 99b4e1e..5f9b995 100755 (executable)
@@ -83,7 +83,7 @@ namespace Tizen.NUI
             if (layoutParent != null)
             {
                  LayoutGroup layoutGroup =  layoutParent as LayoutGroup;
-                 if(layoutGroup.LayoutRequested)
+                 if(layoutGroup != null && !layoutGroup.LayoutRequested)
                  {
                     layoutGroup.RequestLayout();
                  }
@@ -195,7 +195,10 @@ namespace Tizen.NUI
                 for (uint i = 0; i < rootNode.ChildCount; i++)
                 {
                     View view = rootNode.GetChildAt(i);
-                    FindRootLayouts(view);
+                    if (view != null)
+                    {
+                        FindRootLayouts(view);
+                    }
                 }
             }
         }
@@ -295,7 +298,10 @@ namespace Tizen.NUI
                     for (uint i = 0; i < layer.ChildCount; i++)
                     {
                         View view = layer.GetChildAt(i);
-                        FindRootLayouts(view);
+                        if (view != null)
+                        {
+                            FindRootLayouts(view);
+                        }
                     }
                 }
             }
index 75c653b..9cf8784 100755 (executable)
@@ -59,7 +59,7 @@ namespace Tizen.NUI.Binding
                 var queue = new Queue<Element>(16);
                 queue.Enqueue((Element)self);
 
-                while (queue.Count > 0)
+                while (queue.Count > 0 && queue.Dequeue() != null)
                 {
                     ReadOnlyCollection<Element> children = queue.Dequeue().LogicalChildrenInternal;
                     for (var i = 0; i < children.Count; i++)
index 602bb54..c63a1f6 100755 (executable)
@@ -47,7 +47,10 @@ namespace Tizen.NUI
             {
                 RegisterComponent(component.Key, component.Value);
             }
-            (Backend as NUIComponentCoreBackend).ComponentFactories = _componentFactories;
+            if ((Backend as NUIComponentCoreBackend) != null)
+            {
+                (Backend as NUIComponentCoreBackend).ComponentFactories = _componentFactories;
+            } 
         }
 
         /// <summary>
index 5906fcd..89fbfd4 100755 (executable)
@@ -81,11 +81,7 @@ namespace Tizen.NUI
                 _outputVisualMap = new PropertyMap();
                 _outputVisualMap.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.Color));
                 _outputVisualMap.Add(ColorVisualProperty.MixColor, new PropertyValue(_mixColorForColorVisual));
-                if (_shader != null) { _outputVisualMap.Add(Visual.Property.Shader, new PropertyValue(_shader)); }
-                if (_premultipliedAlpha != null) { _outputVisualMap.Add(Visual.Property.PremultipliedAlpha, new PropertyValue((bool)_premultipliedAlpha)); }
-                if (_opacity != null) { _outputVisualMap.Add(Visual.Property.Opacity, new PropertyValue((float)_opacity)); }
-                if (_renderIfTransparent != null) { _outputVisualMap.Add(ColorVisualProperty.RenderIfTransparent, new PropertyValue((bool)_renderIfTransparent)); }
-                if (_visualFittingMode != null) { _outputVisualMap.Add(Visual.Property.VisualFittingMode, new PropertyValue((int)_visualFittingMode)); }
+                base.ComposingPropertyMap();
             }
         }
     }
index d153f93..959545d 100755 (executable)
@@ -325,10 +325,7 @@ namespace Tizen.NUI
             if (_bevelPercentage != null) { _outputVisualMap.Add(PrimitiveVisualProperty.BevelPercentage, new PropertyValue((float)_bevelPercentage)); }
             if (_bevelSmoothness != null) { _outputVisualMap.Add(PrimitiveVisualProperty.BevelSmoothness, new PropertyValue((float)_bevelSmoothness)); }
             if (_lightPosition != null) { _outputVisualMap.Add(PrimitiveVisualProperty.LightPosition, new PropertyValue(_lightPosition)); }
-            if (_shader != null) { _outputVisualMap.Add(Visual.Property.Shader, new PropertyValue(_shader)); }
-            if (_premultipliedAlpha != null) { _outputVisualMap.Add(Visual.Property.PremultipliedAlpha, new PropertyValue((bool)_premultipliedAlpha)); }
-            if (_opacity != null) { _outputVisualMap.Add(Visual.Property.Opacity, new PropertyValue((float)_opacity)); }
-            if (_visualFittingMode != null) { _outputVisualMap.Add(Visual.Property.VisualFittingMode, new PropertyValue((int)_visualFittingMode)); }
+            base.ComposingPropertyMap();
         }
     }
 }
index 851f4e0..99e7834 100755 (executable)
@@ -163,6 +163,7 @@ namespace Tizen.NUI
             _transition.Add("animator", new PropertyValue(_animator));
 
             _outputVisualMap = _transition;
+            base.ComposingPropertyMap();
         }
     }
     //temporary fix for TCT
index 57cd08a..4a164f3 100755 (executable)
@@ -694,7 +694,10 @@ namespace Tizen.NUI.Binding
                     while (delayQueue.Count > 0)
                     {
                         SetValueArgs s = delayQueue.Dequeue();
-                        SetValueActual(s.Property, s.Context, s.Value, s.CurrentlyApplying, forceSendChangeSignal, s.Attributes);
+                        if (s != null)
+                        {
+                            SetValueActual(s.Property, s.Context, s.Value, s.CurrentlyApplying, forceSendChangeSignal, s.Attributes);
+                        }
                     }
 
                     context.DelayedSetters = null;
index 5e868ee..6b2d757 100755 (executable)
@@ -400,7 +400,7 @@ namespace Tizen.NUI.Binding
             var queue = new Queue<Element>(16);
             queue.Enqueue(this);
 
-            while (queue.Count > 0)
+            while (queue.Count > 0 && queue.Dequeue() != null)
             {
                 ReadOnlyCollection<Element> children = queue.Dequeue().LogicalChildrenInternal;
                 for (var i = 0; i < children.Count; i++)
@@ -506,7 +506,7 @@ namespace Tizen.NUI.Binding
             var queue = new Queue<Element>(16);
             queue.Enqueue(this);
 
-            while (queue.Count > 0)
+            while (queue.Count > 0 && queue.Dequeue() != null)
             {
                 ReadOnlyCollection<Element> children = queue.Dequeue().LogicalChildrenInternal;
                 for (var i = 0; i < children.Count; i++)