+
+ //TODO: Refactor "DoRelayout" and extract common code of size calculation without modifying attributes of mVisualModel,
+ //TODO: then calculate GlyphPositions. Lines, Size, Layout for Natural-Size
+ //TODO: and utilize the values in OperationsPending and TextUpdateInfo without changing the original one.
+ //TODO: Also it will improve performance because there is no need todo FullRelyout on the next need for layouting.
+
+ // FullRelayoutNeeded should be true because DoRelayout is MAX_FLOAT, MAX_FLOAT.
+ // By this no need to take backup and restore it.
+ textUpdateInfo.mFullRelayoutNeeded = true;
+
+ // Restore mCharacterIndex. Because "Clear" set it to the maximum integer.
+ // The "CalculateTextUpdateIndices" does not work proprely because the mCharacterIndex will be greater than mPreviousNumberOfCharacters.
+ // Which apply an assumption to update only the last paragraph. That could cause many of out of index crashes.
+ textUpdateInfo.mCharacterIndex = updateInfoCharIndexBackup;
+
+ // Do not do again the only once operations.
+ operationsPending = static_cast<OperationsMask>(operationsPending & ~onlyOnceOperations);
+
+ // Do the size related operations again.
+
+ const OperationsMask sizeOperations = static_cast<OperationsMask>(LAYOUT |
+ ALIGN |
+ REORDER);
+
+ operationsPending = static_cast<OperationsMask>(operationsPending | sizeOperations);