From: Bowon Ryu Date: Fri, 19 May 2023 07:38:40 +0000 (+0900) Subject: [Tizen] Fix initial white space issue in text X-Git-Tag: accepted/tizen/7.0/unified/20230526.164252~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F89%2F293089%2F1;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git [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 --- diff --git a/dali-toolkit/internal/text/controller/text-controller-event-handler.cpp b/dali-toolkit/internal/text/controller/text-controller-event-handler.cpp index f9dc67d..90048e2 100644 --- a/dali-toolkit/internal/text/controller/text-controller-event-handler.cpp +++ b/dali-toolkit/internal/text/controller/text-controller-event-handler.cpp @@ -860,22 +860,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) @@ -883,7 +871,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/controller/text-controller-impl.cpp b/dali-toolkit/internal/text/controller/text-controller-impl.cpp index 9aa4a06..2405862 100644 --- a/dali-toolkit/internal/text/controller/text-controller-impl.cpp +++ b/dali-toolkit/internal/text/controller/text-controller-impl.cpp @@ -444,19 +444,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(); }