r = CreateAutoLink(__strText, autoLink);
SysTryCatch(NID_GRP
, r == E_SUCCESS
- , , r, "[%s] Fails to create native text element.", GetErrorMessage(r));
+ , , r, "[%s] Fails to construct native text element.", GetErrorMessage(r));
__foregroundColor = GetTextColor();
__backgroundColor = GetBackgroundColor();
if (__isAuto == true)
{
r = CreateAutoLink(__strText, __autoLink);
-
if (r == E_SUCCESS)
{
_CutLinkType type = GetCutLinkType();
- __linkType = ConvertObjectLinkType(type);
+ if (type != TEXT_CUTLINK_TYPE_INVALID)
+ {
+ __linkType = ConvertObjectLinkType(type);
- int len = GetLength();
- Tizen::Base::String link;
- __strText.SubString(GetAutolinkSrcOffset(), len, link);
- __linkText = link;
+ Tizen::Base::String link;
+ __strText.SubString(GetAutolinkSrcOffset(), GetLength(), link);
+ __linkText = link;
+ }
SetTextColor(__foregroundColor);
if (__bgColorEnable == true)
pTextLinkInfo = pParser->Parse(pText, len, 0);
if (!pTextLinkInfo)
{
- delete pParser;
- pParser = null;
-
- return E_INVALID_ARG;
+ SysLog(NID_GRP, "[] This instance isn't the link type of TextElement");
+ r = Create(text, len, TEXT_ELEMENT_SOURCE_TYPE_EXTERNAL);
}
-
- __linkOffset = pTextLinkInfo->srcOffset;
-
- if ((ConvertLinkType(pTextLinkInfo->linkType) & autoLink) != 0)
+ else
{
- TextCutLink* pTextElement = null;
+ __linkOffset = pTextLinkInfo->srcOffset;
- pTextElement = new (std::nothrow) TextCutLink(false, pTextLinkInfo->linkType, pText + pTextLinkInfo->srcOffset
- , pTextLinkInfo->length, TEXT_ELEMENT_SOURCE_TYPE_EXTERNAL);
-
- if (pTextElement == null)
+ if ((ConvertLinkType(pTextLinkInfo->linkType) & autoLink) != 0)
{
- if (pParser)
+ TextCutLink* pTextElement = null;
+
+ pTextElement = new (std::nothrow) TextCutLink(false, pTextLinkInfo->linkType, pText + pTextLinkInfo->srcOffset
+ , pTextLinkInfo->length, TEXT_ELEMENT_SOURCE_TYPE_EXTERNAL);
+
+ if (pTextElement == null)
{
- delete pParser;
- pParser = null;
+ if (pParser)
+ {
+ delete pParser;
+ pParser = null;
+ }
+ return E_OUT_OF_MEMORY;
}
- return E_OUT_OF_MEMORY;
- }
- __pTextComponent = pTextElement;
- r = E_SUCCESS;
- }
- else
- {
- r = Create(text, len, TEXT_ELEMENT_SOURCE_TYPE_EXTERNAL);
- }
+ __pTextComponent = pTextElement;
+ r = E_SUCCESS;
+ }
+ else
+ {
+ r = Create(text, len, TEXT_ELEMENT_SOURCE_TYPE_EXTERNAL);
+ }
- while (pTextLinkInfo)
- {
- TextLinkInfo* pCurrent = pTextLinkInfo;
- pTextLinkInfo = pTextLinkInfo->pNextLinkInfo;
- delete pCurrent;
+ while (pTextLinkInfo)
+ {
+ TextLinkInfo* pCurrent = pTextLinkInfo;
+ pTextLinkInfo = pTextLinkInfo->pNextLinkInfo;
+ delete pCurrent;
+ }
}
if (pParser)