When font validation in the relayout process, if text update info is initialized,
font data should be cleared before UpdateModel() to ensure the number of characters removed and added.
Without this condition, incorrect text updates will occur due to incorrect number of characters.
Change-Id: Ic0a56dc355b746b2e718aa87ae61c507ade427b5
Signed-off-by: Bowon Ryu <bowon.ryu@samsung.com>
// Perform a relayout
controller->Relayout(size);
+ // Set the text
+ controller->SetText(text);
+
+ // Set the text size
+ controller->SetDefaultFontSize(10.f, Controller::POINT_SIZE);
+
+ // Tweak some parameters to make the indices to access the text buffer invalid
+ mImpl.mTextUpdateInfo.Clear();
+
+ // Perform a relayout
+ controller->GetHeightForWidth(size.width / 2.f);
+ controller->Relayout(size);
+
tet_result(TET_PASS);
END_TEST;
if(!isEditable)
{
+ if(NO_OPERATION != (VALIDATE_FONTS & operationsPending) &&
+ textUpdateInfo.mCharacterIndex == static_cast<CharacterIndex>(-1))
+ {
+ impl.ClearFontData();
+ updateInfoCharIndexBackup = textUpdateInfo.mCharacterIndex;
+ }
+
impl.UpdateModel(onlyOnceOperations);
// Layout the text for the new width.