From a67684399d92d109aad1f103fd1bf44919c4b8d4 Mon Sep 17 00:00:00 2001 From: Bowon Ryu Date: Tue, 7 Sep 2021 19:20:56 +0900 Subject: [PATCH] [NUI] Change the parameter of SelectText from uint to int SelectedTextStart and SelectedTextEnd properties are int. Change the parameter of SelectText() to int for cosistency. Signed-off-by: Bowon Ryu --- src/Tizen.NUI/src/public/BaseComponents/TextEditor.cs | 12 +++++++++--- src/Tizen.NUI/src/public/BaseComponents/TextField.cs | 12 +++++++++--- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/src/Tizen.NUI/src/public/BaseComponents/TextEditor.cs b/src/Tizen.NUI/src/public/BaseComponents/TextEditor.cs index b451a4d..30a1f6f 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/TextEditor.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/TextEditor.cs @@ -1981,14 +1981,20 @@ namespace Tizen.NUI.BaseComponents } /// - /// Select text from start to end index. + /// Select text from start to end index.
+ /// The index is valid when 0 or positive.
///
/// The start index for selection. /// The end index for selection. [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(); } diff --git a/src/Tizen.NUI/src/public/BaseComponents/TextField.cs b/src/Tizen.NUI/src/public/BaseComponents/TextField.cs index 64db893..cef8fb7 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/TextField.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/TextField.cs @@ -2069,14 +2069,20 @@ namespace Tizen.NUI.BaseComponents } /// - /// Select text from start to end index. + /// Select text from start to end index.
+ /// The index is valid when 0 or positive.
///
/// The start index for selection. /// The end index for selection. [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(); } -- 2.7.4