TextElement* pLastTextElement = (textLength == 0) ? GetElementAtTextIndex(startTextIndex) : GetElementAtTextIndex(startTextIndex + textLength - 1);
SysTryCatch(NID_GRP, pLastTextElement, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get element.");
- if (pLastTextElement->GetType() == TEXT_ELEMENT_TYPE_TEXT)
+ if (pLastTextElement->GetType() == TEXT_ELEMENT_TYPE_TEXT || pLastTextElement->GetType() == TEXT_ELEMENT_TYPE_CUTLINK)
{
TextSimple* pSimpleText = dynamic_cast < TextSimple* >(pLastTextElement);
SysTryCatch(NID_GRP, pSimpleText, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to cast text element.");
pLastDisplayTextElement = (textLength == 0) ? GetElementAtTextIndex(startTextIndex) : GetElementAtTextIndex(startTextIndex + textLength - 1);
SysTryCatch(NID_GRP, pLastDisplayTextElement, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get element.");
- if (pLastDisplayTextElement->GetType() == TEXT_ELEMENT_TYPE_TEXT)
+ if (pLastDisplayTextElement->GetType() == TEXT_ELEMENT_TYPE_TEXT || pLastDisplayTextElement->GetType() == TEXT_ELEMENT_TYPE_CUTLINK)
{
TextSimple* pSimpleText = dynamic_cast < TextSimple* >(pLastDisplayTextElement);
SysTryCatch(NID_GRP, pSimpleText, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to cast text element.");
TextElement* pLastTextElement = GetElementAtTextIndex(startTextIndex + textLength - 1);
SysTryCatch(NID_GRP, pLastTextElement, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get element.");
- if (pLastTextElement->GetType() == TEXT_ELEMENT_TYPE_TEXT)
+ if (pLastTextElement->GetType() == TEXT_ELEMENT_TYPE_TEXT || pLastTextElement->GetType() == TEXT_ELEMENT_TYPE_CUTLINK)
{
TextSimple* pSimpleText = dynamic_cast < TextSimple* >(pLastTextElement);
SysTryCatch(NID_GRP, pSimpleText, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to cast text element.");
{
GetRegion(textIndexFromElementOffset, 1, spaceCharDim.width, spaceCharDim.height);
textLength--;
+ currentLength--;\r
startTextIndex++;
textIndexFromElementOffset++;
}
GetRegion(startTextIndex, textLength, textSize.width, textSize.height);
if (action == TEXT_OBJECT_ACTION_TYPE_ABBREV)
{
- TextElement* pLastTextElement = GetElementAtTextIndex(startTextIndex + textLength - 1);
+ TextElement* pLastTextElement = (textLength == 0) ? GetElementAtTextIndex(startTextIndex) : GetElementAtTextIndex(startTextIndex + textLength - 1);
SysTryCatch(NID_GRP, pLastTextElement, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get element.");
- if (pLastTextElement->GetType() == TEXT_ELEMENT_TYPE_TEXT)
+ if (pLastTextElement->GetType() == TEXT_ELEMENT_TYPE_TEXT || pLastTextElement->GetType() == TEXT_ELEMENT_TYPE_CUTLINK)
{
TextSimple* pSimpleText = dynamic_cast < TextSimple* >(pLastTextElement);
SysTryCatch(NID_GRP, pSimpleText, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to cast text element.");
, TEXT_OBJECT_WRAP_TYPE_CHARACTER, textLength, textSize.width, textSize.height);
textSize.width += abbrevTextDim.width;
- currentLength = textLength;
+ currentLength = Math::Min(currentLength, textLength);
drawAbbrevText = true;
}
SysTryCatch(NID_GRP, r == E_SUCCESS, , r, "[%s] Fail to move next element.", GetErrorMessage(r));
}
+ currentLength = Math::Min(textLength, currentLength);
blockRect = FloatRectangle(adjustedRect.x, displayRect.y, adjustedRect.width, adjustedRect.height);
adjustedRect.y = displayRect.y + displayRect.height - baseline;
canvasImpl.SetTextOrigin(TEXT_ORIGIN_BASELINE);
TextElement* pLastTextElement = GetElementAtTextIndex(lineOffset + lineLength - 1);
SysTryReturn(NID_GRP, pLastTextElement, -1, E_SYSTEM, "[E_SYSTEM] Fail to get element.");
- if (pLastTextElement->GetType() == TEXT_ELEMENT_TYPE_TEXT)
+ if (pLastTextElement->GetType() == TEXT_ELEMENT_TYPE_TEXT || pLastTextElement->GetType() == TEXT_ELEMENT_TYPE_CUTLINK)
{
TextSimple* pSimpleText = dynamic_cast < TextSimple* >(pLastTextElement);
SysTryReturn(NID_GRP, pSimpleText, String(L""), E_SYSTEM, "[E_SYSTEM] Fail to cast text element.");