From e16aff0297cabb1288e582ea04207f506e10c686 Mon Sep 17 00:00:00 2001 From: Bowon Ryu Date: Fri, 19 May 2023 16:38:40 +0900 Subject: [PATCH] [Tizen] Fix initial white space issue in text Current logic does not send text and cursor position for initial white space to IME. I don't know the exact history of this logic. But in case of efl, it is sending information about initial white space to IME. Change behavior for consistency. Change-Id: I86bc7ecfece9f02c2eb670c3359efc31d79daabb Signed-off-by: Bowon Ryu --- .../internal/text/text-controller-event-handler.cpp | 14 +------------- dali-toolkit/internal/text/text-controller-impl.cpp | 13 ------------- 2 files changed, 1 insertion(+), 26 deletions(-) diff --git a/dali-toolkit/internal/text/text-controller-event-handler.cpp b/dali-toolkit/internal/text/text-controller-event-handler.cpp index 5d78405..0b48b8e 100644 --- a/dali-toolkit/internal/text/text-controller-event-handler.cpp +++ b/dali-toolkit/internal/text/text-controller-event-handler.cpp @@ -824,22 +824,10 @@ InputMethodContext::CallbackData Controller::EventHandler::OnInputMethodContextE std::string text; CharacterIndex cursorPosition = 0u; - Length numberOfWhiteSpaces = 0u; if(retrieveCursor) { - numberOfWhiteSpaces = controller.mImpl->GetNumberOfWhiteSpaces(0u); - cursorPosition = controller.mImpl->GetLogicalCursorPosition(); - - if(cursorPosition < numberOfWhiteSpaces) - { - cursorPosition = 0u; - } - else - { - cursorPosition -= numberOfWhiteSpaces; - } } if(retrieveText) @@ -847,7 +835,7 @@ InputMethodContext::CallbackData Controller::EventHandler::OnInputMethodContextE if(!controller.mImpl->IsShowingPlaceholderText()) { // Retrieves the normal text string. - controller.mImpl->GetText(numberOfWhiteSpaces, text); + controller.mImpl->GetText(0u, text); } else { diff --git a/dali-toolkit/internal/text/text-controller-impl.cpp b/dali-toolkit/internal/text/text-controller-impl.cpp index 8a1dd76..7fd0be3 100644 --- a/dali-toolkit/internal/text/text-controller-impl.cpp +++ b/dali-toolkit/internal/text/text-controller-impl.cpp @@ -430,19 +430,6 @@ void Controller::Impl::NotifyInputMethodContext() if(mEventData && mEventData->mInputMethodContext) { CharacterIndex cursorPosition = GetLogicalCursorPosition(); - - const Length numberOfWhiteSpaces = GetNumberOfWhiteSpaces(0u); - - // Update the cursor position by removing the initial white spaces. - if(cursorPosition < numberOfWhiteSpaces) - { - cursorPosition = 0u; - } - else - { - cursorPosition -= numberOfWhiteSpaces; - } - mEventData->mInputMethodContext.SetCursorPosition(cursorPosition); mEventData->mInputMethodContext.NotifyCursorPosition(); } -- 2.7.4