[AT-SPI] TextController: emit characters before delete 24/244724/20
authorKamil Konieczny <k.konieczny@samsung.com>
Wed, 23 Sep 2020 13:00:27 +0000 (15:00 +0200)
committerArtur Świgoń <a.swigon@samsung.com>
Fri, 23 Oct 2020 13:07:00 +0000 (15:07 +0200)
Deleted characters should be emitted to ATSPI before erase, otherwise the
characters following the deleted characters will be emitted.

Change-Id: I915c239e47cb809ff6204e690d4bc9da952f17bf

dali-toolkit/internal/text/text-controller.cpp

index d683c7f..3035062 100644 (file)
@@ -2648,8 +2648,6 @@ bool Controller::RemoveText( int cursorOffset,
       Vector<Character>::Iterator first = currentText.Begin() + cursorIndex;
       Vector<Character>::Iterator last  = first + numberOfCharacters;
 
-      currentText.Erase( first, last );
-
       if( NULL != mImpl->mEditableControlInterface )
       {
         std::string utf8;
@@ -2657,6 +2655,8 @@ bool Controller::RemoveText( int cursorOffset,
         mImpl->mEditableControlInterface->TextDeleted( cursorIndex, numberOfCharacters, utf8 );
       }
 
+      currentText.Erase( first, last );
+
       // Cursor position retreat
       oldCursorIndex = cursorIndex;