[NUI] Fix Svace issue (#1080)
authorhuiyueun <35286162+huiyueun@users.noreply.github.com>
Wed, 16 Oct 2019 04:13:18 +0000 (13:13 +0900)
committerdongsug-song <35130733+dongsug-song@users.noreply.github.com>
Wed, 16 Oct 2019 04:13:18 +0000 (13:13 +0900)
Signed-off-by: huiyu.eun <huiyu.eun@samsung.com>
src/Tizen.NUI.Components/Controls/Popup.cs
src/Tizen.NUI.Components/Controls/SelectButton.cs
src/Tizen.NUI.Components/Controls/Tab.cs
src/Tizen.NUI.Components/Controls/Toast.cs
src/Tizen.NUI/src/internal/AccessibilityActionSignal.cs
src/Tizen.NUI/src/internal/Layouting/LayoutController.cs
src/Tizen.NUI/src/public/BaseComponents/AnimatedVectorImageView.cs
src/Tizen.NUI/src/public/Layouting/LayoutTransition.cs
src/Tizen.NUI/src/public/Rectangle.cs
src/Tizen.NUI/src/public/WatchTime.cs

index 398337524161a05f19e2657d38ed98d7caa0c492..232dfac6384567ea84d1418c967e80bfde778959 100755 (executable)
@@ -750,12 +750,16 @@ namespace Tizen.NUI.Components
             }
             ContentView.RaiseToTop();
 
-            UpdateButton(buttonCount);
-           
-            if (buttonList != null && popupAttributes.ButtonAttributes != null && popupAttributes.ButtonAttributes.Size != null)
+            if (popupAttributes.ButtonAttributes != null && popupAttributes.ButtonAttributes.Size != null)
             {
-                buttonH = (int)popupAttributes.ButtonAttributes.Size.Height;
+                UpdateButton(buttonCount);
+
+                if (buttonList != null)
+                {
+                    buttonH = (int)popupAttributes.ButtonAttributes.Size.Height;
+                }
             }
+
             ContentView.Size2D = new Size2D(Size2D.Width - titleX * 2, Size2D.Height - titleY - titleH - buttonH);
             ContentView.Position2D = new Position2D(titleX, titleY + titleH);
 
index 1e54c055a55d3c42af547974f49ae51f80a9b2e3..d1042a2ce45790c982b3463181c2024eb8818f80 100755 (executable)
@@ -772,20 +772,30 @@ namespace Tizen.NUI.Components
 
             int textPaddingLeft = selectButtonAttributes.TextAttributes.PaddingLeft;
             int textPaddingRight = selectButtonAttributes.TextAttributes.PaddingRight;
-
+            int pos = 0;
             if (LayoutDirection == ViewLayoutDirectionType.RTL)
             {
                 selectButtonAttributes.TextAttributes.HorizontalAlignment = HorizontalAlignment.End;
                 selectButtonAttributes.TextAttributes.Position.X = textPaddingRight;
-                checkShadowImage.Position2D.X = checkBackgroundImage.Position2D.X = checkImage.Position2D.X = (int)(selectButtonAttributes.TextAttributes.Size.Width) + textPaddingLeft + textPaddingRight + IconPadding.End;
+                               pos = (int)(selectButtonAttributes.TextAttributes.Size.Width) + textPaddingLeft + textPaddingRight;
+                if (IconPadding != null)
+                               {
+                    pos += IconPadding.End;
+                               }
 
             }
             else if (LayoutDirection == ViewLayoutDirectionType.LTR)
             {
                 selectButtonAttributes.TextAttributes.HorizontalAlignment = HorizontalAlignment.Begin;
-                selectButtonAttributes.TextAttributes.Position.X = IconPadding.Start + iconWidth + IconPadding.End + textPaddingLeft;
-                checkShadowImage.Position2D.X = checkBackgroundImage.Position2D.X = checkImage.Position2D.X = IconPadding.Start;
-            }
+                selectButtonAttributes.TextAttributes.Position.X = iconWidth + textPaddingLeft;
+                if (IconPadding != null)
+                               {
+                    selectButtonAttributes.TextAttributes.Position.X += (IconPadding.Start + IconPadding.End); 
+                    pos = IconPadding.Start;
+                               }
+            }
+                       
+                       checkShadowImage.Position2D.X = checkBackgroundImage.Position2D.X = checkImage.Position2D.X = pos;
 
         }
 
index 2981edc4b679f1c4408c890f0f2d7c7701a9d10e..0c36281d2efe3b20969d58ab98051141604ac38d 100755 (executable)
@@ -461,7 +461,7 @@ namespace Tizen.NUI.Components
                 {
                     for (int i = 0; i < totalNum; i++)
                     {
-                        preW = itemList[i].TextItem.NaturalSize2D.Width;
+                        preW = (itemList[i].TextItem.NaturalSize2D != null ? itemList[i].TextItem.NaturalSize2D.Width : 0);
                         itemList[i].Position2D.X = preX;
                         itemList[i].Size2D.Width = preW;
                         preX = itemList[i].Position2D.X + preW + itemSpace;
index 96fec81cea7d7e4189685a4100279ffa3474b4a8..9eece3ca91e3315c236896b6368b38ac1ae00a1c 100755 (executable)
@@ -399,25 +399,28 @@ namespace Tizen.NUI.Components
             int _positionY = 0;
 
             _textAreaWidth = _textAreaWidth > maxTextAreaWidth ? maxTextAreaWidth : _textAreaWidth;
-            if (LayoutDirection == ViewLayoutDirectionType.LTR)
+            if (textLabels != null)
             {
-                for (int i = 0; i < textLabels?.Length; i++)
+                if (LayoutDirection == ViewLayoutDirectionType.LTR)
                 {
-                    textLabels[i].Position2D = new Position2D(_textPaddingLeft, _textPaddingTop + _positionY);
-                    textLabels[i].Size2D = new Size2D(_textAreaWidth, _textLineHeight);
-                    _positionY += _textLineHeight + _textLineSpace;
+                    for (int i = 0; i < textLabels?.Length; i++)
+                    {
+                        textLabels[i].Position2D = new Position2D(_textPaddingLeft, _textPaddingTop + _positionY);
+                        textLabels[i].Size2D = new Size2D(_textAreaWidth, _textLineHeight);
+                        _positionY += _textLineHeight + _textLineSpace;
+                    }
                 }
-            }
-            else
-            {
-                for (int i = 0; i < textLabels?.Length; i++)
+                else
                 {
-                    textLabels[i].ParentOrigin = Tizen.NUI.ParentOrigin.TopRight;
-                    textLabels[i].PivotPoint = Tizen.NUI.PivotPoint.TopRight;
-                    textLabels[i].PositionUsesPivotPoint = true;
-                    textLabels[i].Position2D = new Position2D(-_textPaddingLeft, _textPaddingTop + _positionY);
-                    textLabels[i].Size2D = new Size2D(_textAreaWidth, _textLineHeight);
-                    _positionY += _textLineHeight + _textLineSpace;
+                    for (int i = 0; i < textLabels?.Length; i++)
+                    {
+                        textLabels[i].ParentOrigin = Tizen.NUI.ParentOrigin.TopRight;
+                        textLabels[i].PivotPoint = Tizen.NUI.PivotPoint.TopRight;
+                        textLabels[i].PositionUsesPivotPoint = true;
+                        textLabels[i].Position2D = new Position2D(-_textPaddingLeft, _textPaddingTop + _positionY);
+                        textLabels[i].Size2D = new Size2D(_textAreaWidth, _textLineHeight);
+                        _positionY += _textLineHeight + _textLineSpace;
+                    }
                 }
             }
         }
index 2efe86160ee511190b315e9a57eb74a73f467690..94fc7584c05eb3d94905fb14c40f7d5fa8978ba3 100755 (executable)
@@ -62,8 +62,7 @@ namespace Tizen.NUI
                 }
                 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
             }
-
-            disposed = true;
+            base.Dispose(type);
         }
 
         public bool Empty()
index 7a5cfe19161992e471431bc862324e639e7985c0..9fc6288cb38fa2053ba3df16664ae93e7396579e 100755 (executable)
@@ -292,10 +292,13 @@ namespace Tizen.NUI
             for (uint layerIndex = 0; layerIndex < numberOfLayers; layerIndex++)
             {
                 Layer layer = _window.GetLayer(layerIndex);
-                for (uint i = 0; i < layer.ChildCount; i++)
+                if (layer)
                 {
-                    View view = layer.GetChildAt(i);
-                    FindRootLayouts(view);
+                    for (uint i = 0; i < layer.ChildCount; i++)
+                    {
+                        View view = layer.GetChildAt(i);
+                        FindRootLayouts(view);
+                    }
                 }
             }
 
index 240ba7e0078d1d65190a2e811ba37a5e99d672b0..532fcf54ac126d5a578aaaa8273d26110afbc483 100755 (executable)
@@ -469,7 +469,7 @@ namespace Tizen.NUI.BaseComponents
 
                                 Tuple<string, int, int> item = new Tuple<string, int, int>(key, startFrame, endFrame );
 
-                                currentStates.contentInfo.Add(item);
+                                currentStates.contentInfo?.Add(item);
                             }
                         }
                     }
index 5f23f4f0d66d499c2150fbc8f9abd7e1587b40ec..a33da6f9d9d9634dd1708d49e1c8ba8a0b560cfa 100755 (executable)
@@ -229,15 +229,18 @@ namespace Tizen.NUI
             TransitionList transitionListMatchingCondition;
             if (targetTransitionList.TryGetValue(condition, out transitionListMatchingCondition))
             {
-                for (var index=0; index < transitionListMatchingCondition?.Count; index++ )
+                if (transitionListMatchingCondition != null)
                 {
-                    if (transitionListMatchingCondition[index].AnimatableProperty == transition.AnimatableProperty)
+                    for (var index = 0; index < transitionListMatchingCondition.Count; index++ )
                     {
-                        if (explicitlySet)
+                        if (transitionListMatchingCondition[index].AnimatableProperty == transition.AnimatableProperty)
                         {
-                            transitionListMatchingCondition[index] = transition;
-                            replaced = true;
-                            continue;
+                            if (explicitlySet)
+                            {
+                                transitionListMatchingCondition[index] = transition;
+                                replaced = true;
+                                continue;
+                            }
                         }
                     }
                 }
index f0d1d5eb4ce65bc980e4cd620f8d6349340897b9..3d14b1a9c499f08841929d6456e33dee4e429b24 100755 (executable)
@@ -456,7 +456,7 @@ namespace Tizen.NUI
                 }
                 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
             }
-            disposed = true;
+            base.Dispose(type);
         }
     }
 }
\ No newline at end of file
index 6a9239b29654ce13828b4ea0dbd7717a3d2a53e1..f8d5b343fb1ca347828d38881a5607481ba57330 100755 (executable)
@@ -325,8 +325,7 @@ namespace Tizen.NUI
                 }
                 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
             }
-
-            disposed = true;
+            base.Dispose(type);
         }
     }
 }