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
Merge "Resolved incorrect size when call GetTextSize(TextLabel) for one glyph" into...
[platform/core/uifw/dali-toolkit.git]
/
dali-toolkit
/
internal
/
text
/
markup-processor-embedded-item.cpp
diff --git
a/dali-toolkit/internal/text/markup-processor-embedded-item.cpp
b/dali-toolkit/internal/text/markup-processor-embedded-item.cpp
old mode 100755
(executable)
new mode 100644
(file)
index
7751c01
..
94d6fd4
--- a/
dali-toolkit/internal/text/markup-processor-embedded-item.cpp
+++ b/
dali-toolkit/internal/text/markup-processor-embedded-item.cpp
@@
-1,5
+1,5
@@
/*
/*
- * Copyright (c) 20
19
Samsung Electronics Co., Ltd.
+ * Copyright (c) 20
21
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.
@@
-25,59
+25,52
@@
// INTERNAL INCLUDES
#include <dali-toolkit/internal/text/embedded-item.h>
#include <dali-toolkit/internal/text/markup-processor-helper-functions.h>
// INTERNAL INCLUDES
#include <dali-toolkit/internal/text/embedded-item.h>
#include <dali-toolkit/internal/text/markup-processor-helper-functions.h>
+#include <dali-toolkit/internal/text/markup-tags-and-attributes.h>
namespace Dali
{
namespace Dali
{
-
namespace Toolkit
{
namespace Toolkit
{
-
namespace Text
{
namespace Text
{
-
namespace
{
namespace
{
-const std::string XHTML_URL_ATTRIBUTE("url");
-const std::string XHTML_WIDTH_ATTRIBUTE("width");
-const std::string XHTML_HEIGHT_ATTRIBUTE("height");
-const std::string XHTML_COLOR_BLENDING_ATTRIBUTE("color-blending");
-
const std::string NONE("none");
const std::string MULTIPLY("multiply");
const std::string NONE("none");
const std::string MULTIPLY("multiply");
-}
+}
// namespace
-void ProcessEmbeddedItem(
const Tag& tag, EmbeddedItem& embeddedItem
)
+void ProcessEmbeddedItem(
const Tag& tag, EmbeddedItem& embeddedItem
)
{
{
- embeddedItem.url = nullptr;
- embeddedItem.urlLength = 0u;
- embeddedItem.width = 0u;
- embeddedItem.height = 0u;
+ embeddedItem.url
= nullptr;
+ embeddedItem.urlLength
= 0u;
+ embeddedItem.width
= 0u;
+ embeddedItem.height
= 0u;
embeddedItem.colorBlendingMode = ColorBlendingMode::NONE;
embeddedItem.colorBlendingMode = ColorBlendingMode::NONE;
- for(
Vector<Attribute>::ConstIterator it
= tag.attributes.Begin(),
- endIt = tag.attributes.End();
-
it != endIt;
-
++it
)
+ for(
Vector<Attribute>::ConstIterator it
= tag.attributes.Begin(),
+
endIt = tag.attributes.End();
+ it != endIt;
+
++it
)
{
{
- const Attribute& attribute(
*it
);
- if(
TokenComparison(XHTML_URL_ATTRIBUTE, attribute.nameBuffer, attribute.nameLength )
)
+ const Attribute& attribute(
*it
);
+ if(
TokenComparison(MARKUP::EMBEDDED_ITEM_ATTRIBUTES::URL, attribute.nameBuffer, attribute.nameLength)
)
{
embeddedItem.urlLength = attribute.valueLength;
{
embeddedItem.urlLength = attribute.valueLength;
- embeddedItem.url = new char[embeddedItem.urlLength];
+ embeddedItem.url
= new char[embeddedItem.urlLength];
memcpy(embeddedItem.url, attribute.valueBuffer, embeddedItem.urlLength);
// The memory is freed when the font run is removed from the logical model.
}
memcpy(embeddedItem.url, attribute.valueBuffer, embeddedItem.urlLength);
// The memory is freed when the font run is removed from the logical model.
}
- else if
(TokenComparison(XHTML_WIDTH_ATTRIBUTE
, attribute.nameBuffer, attribute.nameLength))
+ else if
(TokenComparison(MARKUP::EMBEDDED_ITEM_ATTRIBUTES::WIDTH
, attribute.nameBuffer, attribute.nameLength))
{
embeddedItem.width = StringToUint(attribute.valueBuffer);
}
{
embeddedItem.width = StringToUint(attribute.valueBuffer);
}
- else if
(TokenComparison(XHTML_HEIGHT_ATTRIBUTE
, attribute.nameBuffer, attribute.nameLength))
+ else if
(TokenComparison(MARKUP::EMBEDDED_ITEM_ATTRIBUTES::HEIGHT
, attribute.nameBuffer, attribute.nameLength))
{
embeddedItem.height = StringToUint(attribute.valueBuffer);
}
{
embeddedItem.height = StringToUint(attribute.valueBuffer);
}
- else if
(TokenComparison(XHTML_COLOR_BLENDING_ATTRIBUTE
, attribute.nameBuffer, attribute.nameLength))
+ else if
(TokenComparison(MARKUP::EMBEDDED_ITEM_ATTRIBUTES::COLOR_BLENDING
, attribute.nameBuffer, attribute.nameLength))
{
{
- if
(TokenComparison(MULTIPLY, attribute.valueBuffer, attribute.valueLength))
+ if(TokenComparison(MULTIPLY, attribute.valueBuffer, attribute.valueLength))
{
embeddedItem.colorBlendingMode = ColorBlendingMode::MULTIPLY;
}
{
embeddedItem.colorBlendingMode = ColorBlendingMode::MULTIPLY;
}