[Tizen] Reset Preedit variables in 'Delete All' state
authorHeeyong Song <heeyong.song@samsung.com>
Wed, 20 Nov 2019 08:34:54 +0000 (17:34 +0900)
committerHeeyong Song <heeyong.song@samsung.com>
Wed, 20 Nov 2019 08:34:57 +0000 (17:34 +0900)
dali-toolkit/internal/text/text-controller.cpp

index f82eada..9f524dc 100755 (executable)
@@ -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 );