[NUI] Change the parameter of SelectText from uint to int
authorBowon Ryu <bowon.ryu@samsung.com>
Tue, 7 Sep 2021 10:20:56 +0000 (19:20 +0900)
committerSeoyeon2Kim <34738918+Seoyeon2Kim@users.noreply.github.com>
Mon, 13 Sep 2021 07:33:23 +0000 (16:33 +0900)
SelectedTextStart and SelectedTextEnd properties are int.
Change the parameter of SelectText() to int for cosistency.

Signed-off-by: Bowon Ryu <bowon.ryu@samsung.com>
src/Tizen.NUI/src/public/BaseComponents/TextEditor.cs
src/Tizen.NUI/src/public/BaseComponents/TextField.cs

index b451a4d..30a1f6f 100755 (executable)
@@ -1981,14 +1981,20 @@ namespace Tizen.NUI.BaseComponents
         }
 
         /// <summary>
-        /// Select text from start to end index.
+        /// Select text from start to end index. <br />
+        /// The index is valid when 0 or positive. <br />
         /// </summary>
         /// <param name="start">The start index for selection.</param>
         /// <param name="end">The end index for selection.</param>
         [EditorBrowsable(EditorBrowsableState.Never)]
-        public void SelectText(uint start, uint end)
+        public void SelectText(int start, int end)
         {
-            Interop.TextEditor.SelectText(SwigCPtr, start, end);
+            if (start < 0)
+                throw new global::System.ArgumentOutOfRangeException(nameof(start), "Value is less than zero");
+            if (end < 0)
+                throw new global::System.ArgumentOutOfRangeException(nameof(end), "Value is less than zero");
+
+            Interop.TextEditor.SelectText(SwigCPtr, (uint)start, (uint)end);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
         }
 
index 64db893..cef8fb7 100755 (executable)
@@ -2069,14 +2069,20 @@ namespace Tizen.NUI.BaseComponents
         }
 
         /// <summary>
-        /// Select text from start to end index.
+        /// Select text from start to end index. <br />
+        /// The index is valid when 0 or positive. <br />
         /// </summary>
         /// <param name="start">The start index for selection.</param>
         /// <param name="end">The end index for selection.</param>
         [EditorBrowsable(EditorBrowsableState.Never)]
-        public void SelectText(uint start, uint end)
+        public void SelectText(int start, int end)
         {
-            Interop.TextField.SelectText(SwigCPtr, start, end);
+            if (start < 0)
+                throw new global::System.ArgumentOutOfRangeException(nameof(start), "Value is less than zero");
+            if (end < 0)
+                throw new global::System.ArgumentOutOfRangeException(nameof(end), "Value is less than zero");
+
+            Interop.TextField.SelectText(SwigCPtr, (uint)start, (uint)end);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
         }