- // If a GetTextLayoutInfo() or GetHeightForWidth() arrives, relayout the text synchronously is needed on order to retrieve the right values.
- mRelayoutOperations = RELAYOUT_ALL;
+ SetText( textToSet );
+ }
+ else
+ {
+ // Creates metadata with the Insert operation.
+ TextViewProcessorMetadata metadata;
+ metadata.mType = TextView::TextReplaced;
+ metadata.mPosition = position;
+ metadata.mNumberOfCharacters = numberOfCharacters;
+ metadata.mText = text;
+
+ // Store metadata.
+ mTextViewProcessorOperations.push_back( metadata );
+
+ // Updates current styled text.
+ MarkupProcessor::StyledTextArray::iterator it = mCurrentStyledText.begin() + position;
+ mCurrentStyledText.erase( it, it + numberOfCharacters );
+ it = mCurrentStyledText.begin() + position;
+ mCurrentStyledText.insert( it, text.begin(), text.end() );
+
+ // Request to be relaid out
+ RelayoutRequest();
+
+ // If a GetTextLayoutInfo() or GetHeightForWidth() arrives, relayout the text synchronously is needed on order to retrieve the right values.
+ mRelayoutOperations = RELAYOUT_ALL;
+ }