X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Ftext%2Flogical-model-impl.cpp;h=9ad00bc3031e7dd87d28f38243f763cf02a33d84;hp=8ecab1fa04c22e356f3550f5e64695fbd55e3cc4;hb=29bbe2381a1cfdd96757dfd441e7f9747560b2c8;hpb=2ca1c3856ce848a94f54444f1014a820e91ee207 diff --git a/dali-toolkit/internal/text/logical-model-impl.cpp b/dali-toolkit/internal/text/logical-model-impl.cpp index 8ecab1f..9ad00bc 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 @@ -55,6 +56,16 @@ void FreeEmbeddedItems(Vector& embeddedItem) embeddedItem.Clear(); } +void FreeAnchors(Vector& anchors) +{ + for(auto&& anchor : anchors) + { + delete[] anchor.href; + } + + anchors.Clear(); +} + LogicalModelPtr LogicalModel::New() { return LogicalModelPtr(new LogicalModel()); @@ -286,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, @@ -304,6 +332,19 @@ 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); } void LogicalModel::RetrieveStyle(CharacterIndex index, InputStyle& style) @@ -444,6 +485,11 @@ void LogicalModel::ClearFontDescriptionRuns() FreeFontFamilyNames(mFontDescriptionRuns); } +void LogicalModel::ClearStrikethroughRuns() +{ + mStrikethroughCharacterRuns.Clear(); +} + void LogicalModel::CreateParagraphInfo(CharacterIndex startIndex, Length numberOfCharacters) { @@ -568,11 +614,26 @@ void LogicalModel::FindParagraphs(CharacterIndex index, } } +Length LogicalModel::GetNumberOfBoundedParagraphRuns() const +{ + return mBoundedParagraphRuns.Count(); +} + +const Vector& LogicalModel::GetBoundedParagraphRuns() const +{ + return mBoundedParagraphRuns; +} + void LogicalModel::ClearEmbeddedImages() { FreeEmbeddedItems(mEmbeddedItems); } +void LogicalModel::ClearAnchors() +{ + FreeAnchors(mAnchors); +} + LogicalModel::~LogicalModel() { ClearFontDescriptionRuns();