X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Ftext%2Flogical-model-impl.cpp;h=7ebf2a780a719806701bd400d8443a5bdce88807;hb=702cdc29b907688eef62afbc63f0edb9e2dfb7d2;hp=12929fcedd24e3da888f911c88380cac0a77bb45;hpb=8189dd071c31a8958d71d99fc9cd65de6a85ccb6;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/text/logical-model-impl.cpp b/dali-toolkit/internal/text/logical-model-impl.cpp index 12929fc..7ebf2a7 100644 --- a/dali-toolkit/internal/text/logical-model-impl.cpp +++ b/dali-toolkit/internal/text/logical-model-impl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Samsung Electronics Co., Ltd. + * Copyright (c) 2022 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,6 +19,7 @@ #include // INTERNAL INCLUDES +#include #include #include @@ -296,6 +297,23 @@ void LogicalModel::UpdateTextStyleRuns(CharacterIndex index, int numberOfCharact mColorRuns, removedColorRuns); + // This is needed until now for underline tag in mark-up processor + // Process the underlined runs. + Vector removedUnderlinedCharacterRuns; + UpdateCharacterRuns(index, + numberOfCharacters, + totalNumberOfCharacters, + mUnderlinedCharacterRuns, + removedUnderlinedCharacterRuns); + + // Process the strikethrough runs. + Vector removedStrikethroughCharacterRuns; + UpdateCharacterRuns(index, + numberOfCharacters, + totalNumberOfCharacters, + mStrikethroughCharacterRuns, + removedStrikethroughCharacterRuns); + // Process the background color runs. Vector removedBackgroundColorRuns; UpdateCharacterRuns(index, @@ -314,6 +332,26 @@ void LogicalModel::UpdateTextStyleRuns(CharacterIndex index, int numberOfCharact // Free memory allocated for the font family name. FreeFontFamilyNames(removedFontDescriptionRuns); + + // Process the bounded paragraph runs + MergeBoundedParagraphRunsWhenRemoveCharacters(mText, + index, + numberOfCharacters, + mBoundedParagraphRuns); + + Vector removedBoundedParagraphRuns; + UpdateCharacterRuns(index, + numberOfCharacters, + totalNumberOfCharacters, + mBoundedParagraphRuns, + removedBoundedParagraphRuns); + + Vector removedCharacterSpacingCharacterRuns; + UpdateCharacterRuns(index, + numberOfCharacters, + totalNumberOfCharacters, + mCharacterSpacingCharacterRuns, + removedCharacterSpacingCharacterRuns); } void LogicalModel::RetrieveStyle(CharacterIndex index, InputStyle& style) @@ -454,6 +492,11 @@ void LogicalModel::ClearFontDescriptionRuns() FreeFontFamilyNames(mFontDescriptionRuns); } +void LogicalModel::ClearStrikethroughRuns() +{ + mStrikethroughCharacterRuns.Clear(); +} + void LogicalModel::CreateParagraphInfo(CharacterIndex startIndex, Length numberOfCharacters) { @@ -578,6 +621,26 @@ void LogicalModel::FindParagraphs(CharacterIndex index, } } +Length LogicalModel::GetNumberOfBoundedParagraphRuns() const +{ + return mBoundedParagraphRuns.Count(); +} + +const Vector& LogicalModel::GetBoundedParagraphRuns() const +{ + return mBoundedParagraphRuns; +} + +Length LogicalModel::GetNumberOfCharacterSpacingCharacterRuns() const +{ + return mCharacterSpacingCharacterRuns.Count(); +} + +const Vector& LogicalModel::GetCharacterSpacingCharacterRuns() const +{ + return mCharacterSpacingCharacterRuns; +} + void LogicalModel::ClearEmbeddedImages() { FreeEmbeddedItems(mEmbeddedItems);