projects
/
platform
/
core
/
uifw
/
dali-toolkit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[AT-SPI] Support reading states and tooltips of ToggleButton
[platform/core/uifw/dali-toolkit.git]
/
dali-toolkit
/
internal
/
text
/
logical-model-impl.cpp
diff --git
a/dali-toolkit/internal/text/logical-model-impl.cpp
b/dali-toolkit/internal/text/logical-model-impl.cpp
old mode 100644
(file)
new mode 100755
(executable)
index
b9921c2
..
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) 201
5
Samsung Electronics Co., Ltd.
+ * Copyright (c) 201
9
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.
*
* 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<FontDescriptionRun>& fontDescriptionRuns )
it != endIt;
++it )
{
it != endIt;
++it )
{
- delete (*it).familyName;
+ delete
[]
(*it).familyName;
}
fontDescriptionRuns.Clear();
}
}
fontDescriptionRuns.Clear();
}
+void FreeEmbeddedItems( Vector<EmbeddedItem>& embeddedItem )
+{
+ for( Vector<EmbeddedItem>::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() );
LogicalModelPtr LogicalModel::New()
{
return LogicalModelPtr( new LogicalModel() );
@@
-53,9
+67,10
@@
Script LogicalModel::GetScript( CharacterIndex characterIndex ) const
{
// If this operation is too slow, consider a binary search.
{
// If this operation is too slow, consider a binary search.
+ const ScriptRun* const scriptRunBuffer = mScriptRuns.Begin();
for( Length index = 0u, length = mScriptRuns.Count(); index < length; ++index )
{
for( Length index = 0u, length = mScriptRuns.Count(); index < length; ++index )
{
- const ScriptRun* const scriptRun =
mScriptRuns.Begin()
+ index;
+ const ScriptRun* const scriptRun =
scriptRunBuffer
+ index;
if( ( scriptRun->characterRun.characterIndex <= characterIndex ) &&
( characterIndex < scriptRun->characterRun.characterIndex + scriptRun->characterRun.numberOfCharacters ) )
if( ( scriptRun->characterRun.characterIndex <= characterIndex ) &&
( characterIndex < scriptRun->characterRun.characterIndex + scriptRun->characterRun.numberOfCharacters ) )
@@
-274,6
+289,14
@@
void LogicalModel::UpdateTextStyleRuns( CharacterIndex index, int numberOfCharac
mColorRuns,
removedColorRuns );
mColorRuns,
removedColorRuns );
+ // Process the background color runs.
+ Vector<ColorRun> removedBackgroundColorRuns;
+ UpdateCharacterRuns<ColorRun>( index,
+ numberOfCharacters,
+ totalNumberOfCharacters,
+ mBackgroundColorRuns,
+ removedBackgroundColorRuns );
+
// Process the font description runs.
Vector<FontDescriptionRun> removedFontDescriptionRuns;
UpdateCharacterRuns<FontDescriptionRun>( index,
// Process the font description runs.
Vector<FontDescriptionRun> removedFontDescriptionRuns;
UpdateCharacterRuns<FontDescriptionRun>( index,
@@
-379,7
+402,7
@@
void LogicalModel::RetrieveStyle( CharacterIndex index, InputStyle& style )
const FontDescriptionRun& fontDescriptionRun = *( fontDescriptionRunsBuffer + nameIndex );
style.familyName = std::string( fontDescriptionRun.familyName, fontDescriptionRun.familyLength );
const FontDescriptionRun& fontDescriptionRun = *( fontDescriptionRunsBuffer + nameIndex );
style.familyName = std::string( fontDescriptionRun.familyName, fontDescriptionRun.familyLength );
- style.
f
amilyDefined = true;
+ style.
isF
amilyDefined = true;
}
// Set the font's weight if it's overriden.
}
// Set the font's weight if it's overriden.
@@
-388,7
+411,7
@@
void LogicalModel::RetrieveStyle( CharacterIndex index, InputStyle& style )
const FontDescriptionRun& fontDescriptionRun = *( fontDescriptionRunsBuffer + weightIndex );
style.weight = fontDescriptionRun.weight;
const FontDescriptionRun& fontDescriptionRun = *( fontDescriptionRunsBuffer + weightIndex );
style.weight = fontDescriptionRun.weight;
- style.
w
eightDefined = true;
+ style.
isW
eightDefined = true;
}
// Set the font's width if it's overriden.
}
// Set the font's width if it's overriden.
@@
-397,7
+420,7
@@
void LogicalModel::RetrieveStyle( CharacterIndex index, InputStyle& style )
const FontDescriptionRun& fontDescriptionRun = *( fontDescriptionRunsBuffer + widthIndex );
style.width = fontDescriptionRun.width;
const FontDescriptionRun& fontDescriptionRun = *( fontDescriptionRunsBuffer + widthIndex );
style.width = fontDescriptionRun.width;
- style.
w
idthDefined = true;
+ style.
isW
idthDefined = true;
}
// Set the font's slant if it's overriden.
}
// Set the font's slant if it's overriden.
@@
-406,7
+429,7
@@
void LogicalModel::RetrieveStyle( CharacterIndex index, InputStyle& style )
const FontDescriptionRun& fontDescriptionRun = *( fontDescriptionRunsBuffer + slantIndex );
style.slant = fontDescriptionRun.slant;
const FontDescriptionRun& fontDescriptionRun = *( fontDescriptionRunsBuffer + slantIndex );
style.slant = fontDescriptionRun.slant;
- style.
s
lantDefined = true;
+ style.
isS
lantDefined = true;
}
// Set the font's size if it's overriden.
}
// Set the font's size if it's overriden.
@@
-415,7
+438,7
@@
void LogicalModel::RetrieveStyle( CharacterIndex index, InputStyle& style )
const FontDescriptionRun& fontDescriptionRun = *( fontDescriptionRunsBuffer + sizeIndex );
style.size = static_cast<float>( fontDescriptionRun.size ) / 64.f;
const FontDescriptionRun& fontDescriptionRun = *( fontDescriptionRunsBuffer + sizeIndex );
style.size = static_cast<float>( fontDescriptionRun.size ) / 64.f;
- style.
s
izeDefined = true;
+ style.
isS
izeDefined = true;
}
}
}
}
@@
-549,9
+572,15
@@
void LogicalModel::FindParagraphs( CharacterIndex index,
}
}
}
}
+void LogicalModel::ClearEmbeddedImages()
+{
+ FreeEmbeddedItems( mEmbeddedItems );
+}
+
LogicalModel::~LogicalModel()
{
ClearFontDescriptionRuns();
LogicalModel::~LogicalModel()
{
ClearFontDescriptionRuns();
+ ClearEmbeddedImages();
}
LogicalModel::LogicalModel()
}
LogicalModel::LogicalModel()