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=3d9440e6ff73e2616aa6a60f6dc67e3b310a4761;hp=9b669258b56b025364e53f04ed524f626a7c45f5;hb=d48e9b8b161367ad699c0352dfeb0128832bbe59;hpb=260c832bfaa0294e74a4f96d321f149adf09a3ce diff --git a/dali-toolkit/internal/text/logical-model-impl.cpp b/dali-toolkit/internal/text/logical-model-impl.cpp old mode 100644 new mode 100755 index 9b66925..3d9440e --- a/dali-toolkit/internal/text/logical-model-impl.cpp +++ b/dali-toolkit/internal/text/logical-model-impl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016 Samsung Electronics Co., Ltd. + * Copyright (c) 2019 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. @@ -38,12 +38,26 @@ void FreeFontFamilyNames( Vector& fontDescriptionRuns ) it != endIt; ++it ) { - delete (*it).familyName; + delete[] (*it).familyName; } fontDescriptionRuns.Clear(); } +void FreeEmbeddedItems( Vector& embeddedItem ) +{ + for( Vector::Iterator it = embeddedItem.Begin(), + endIt = embeddedItem.End(); + it != endIt; + ++it ) + { + EmbeddedItem& item = *it; + delete[] item.url; + } + + embeddedItem.Clear(); +} + LogicalModelPtr LogicalModel::New() { return LogicalModelPtr( new LogicalModel() ); @@ -275,6 +289,14 @@ void LogicalModel::UpdateTextStyleRuns( CharacterIndex index, int numberOfCharac mColorRuns, removedColorRuns ); + // Process the background color runs. + Vector removedBackgroundColorRuns; + UpdateCharacterRuns( index, + numberOfCharacters, + totalNumberOfCharacters, + mBackgroundColorRuns, + removedBackgroundColorRuns ); + // Process the font description runs. Vector removedFontDescriptionRuns; UpdateCharacterRuns( index, @@ -550,9 +572,15 @@ void LogicalModel::FindParagraphs( CharacterIndex index, } } +void LogicalModel::ClearEmbeddedImages() +{ + FreeEmbeddedItems( mEmbeddedItems ); +} + LogicalModel::~LogicalModel() { ClearFontDescriptionRuns(); + ClearEmbeddedImages(); } LogicalModel::LogicalModel()