From: Seoyeon Kim Date: Fri, 1 Nov 2019 08:14:51 +0000 (+0900) Subject: Reset Preedit variables in 'Delete All' state X-Git-Tag: dali_1.4.48~5^2 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=commitdiff_plain;h=97ad1b9af574f894127d52691d793b219b7003e0;ds=sidebyside 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 --- 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 );