From 97ad1b9af574f894127d52691d793b219b7003e0 Mon Sep 17 00:00:00 2001 From: Seoyeon Kim Date: Fri, 1 Nov 2019 17:14:51 +0900 Subject: [PATCH] Reset Preedit variables in 'Delete All' state - If the number of current text and the number of characters to be deleted are same, it means all texts should be removed and all Preedit variables should be initialized. : mPreEditStartPosition and mPreEditLength Change-Id: I3648925c776251ff03aeb77102e2910e4d09ee33 Signed-off-by: Seoyeon Kim --- dali-toolkit/internal/text/text-controller.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/dali-toolkit/internal/text/text-controller.cpp b/dali-toolkit/internal/text/text-controller.cpp index f82eada..9f524dc 100755 --- a/dali-toolkit/internal/text/text-controller.cpp +++ b/dali-toolkit/internal/text/text-controller.cpp @@ -3712,6 +3712,17 @@ bool Controller::RemoveText( int cursorOffset, } } + // If the number of current text and the number of characters to be deleted are same, + // it means all texts should be removed and all Preedit variables should be initialized. + if( ( currentText.Count() - numberOfCharacters == 0 ) && ( cursorIndex == 0 ) ) + { + if( mImpl->mEventData ) + { + mImpl->mEventData->mPreEditStartPosition = 0; + mImpl->mEventData->mPreEditLength = 0; + } + } + // Updates the text style runs by removing characters. Runs with no characters are removed. mImpl->mModel->mLogicalModel->UpdateTextStyleRuns( cursorIndex, -numberOfCharacters ); -- 2.7.4