- if( mHighlightMeshActor )
- {
- mCursorPosition = std::min( mSelectionHandleOnePosition, mSelectionHandleTwoPosition );
-
- MarkupProcessor::StyledTextArray::iterator start = mStyledText.begin() + mCursorPosition;
- MarkupProcessor::StyledTextArray::iterator end = mStyledText.begin() + std::max( mSelectionHandleOnePosition, mSelectionHandleTwoPosition );
-
- // Get the styled text of the characters to be deleted as it may be needed if
- // the "exceed the text-input's boundaries" option is disabled.
- MarkupProcessor::StyledTextArray styledCharactersToDelete;
-
- styledCharactersToDelete.insert( styledCharactersToDelete.begin(), start, end );
-
- mStyledText.erase( start, end ); // erase range of characters
-
- // Remove text from TextView and update place holder text if required
-
- // Set the placeholder text only if the styled text is empty.
- if( mStyledText.empty() )
- {
- ShowPlaceholderText( mStyledPlaceHolderText );
- }
- else
- {
- const std::size_t numberOfCharacters = std::max( mSelectionHandleOnePosition, mSelectionHandleTwoPosition ) - mCursorPosition;
-
- mDisplayedTextView.RemoveTextFrom( mCursorPosition, numberOfCharacters );
-
- // It may happen than after removing a white space or a new line character,
- // two words merge, this new word could be big enough to not fit in its
- // current line, so moved to the next one, and make some part of the text to
- // exceed the text-input's boundary.
- if( !mExceedEnabled )
- {
- // Get the new text layout after removing some characters.
- mDisplayedTextView.GetTextLayoutInfo( mTextLayoutInfo );
-
- // Get text-input's size.
- const Vector3& size = GetControlSize();
-
- if( ( mTextLayoutInfo.mTextSize.width > size.width ) ||
- ( mTextLayoutInfo.mTextSize.height > size.height ) )
- {
- mDisplayedTextView.InsertTextAt( mCursorPosition, styledCharactersToDelete );
-
- mStyledText.insert( mStyledText.begin() + mCursorPosition,
- styledCharactersToDelete.begin(),
- styledCharactersToDelete.end() );
- }
- }
- }
- GetTextLayoutInfo();
-
- RemoveHighlight();
-
- EmitTextModified();
-
- if( inheritStyle )
- {
- const TextStyle oldInputStyle( mInputStyle );
-
- mInputStyle = GetStyleAtCursor(); // Inherit style from cursor position
-
- if( oldInputStyle != mInputStyle )
- {
- // Updates the line height accordingly with the input style.
- UpdateLineHeight();
-
- EmitStyleChangedSignal();
- }
- }
- }