__pLinkedListTextElementList = null;
__pTextElement = null;
__isCopiedEnrichedText = false;
- __pLinkedListTextElementList = null;
__pTextElement = null;
}
, E_INVALID_ARG, E_INVALID_ARG
, "[E_INVALID_ARG] The argument is invalid.");
- if (__pTextObject.use_count() > 1)
- {
- return E_SUCCESS;
- }
-
result r = E_SUCCESS;
int count = GetTextElementCount();
TextElement* pTextElement = null;
SysTryReturn(NID_GRP, __pTextObject != null, E_OPERATION_FAILED, E_OPERATION_FAILED
, "[E_OPERATION_FAILED] This instance is not constructed yet.");
- if (__pTextObject.use_count() > 1)
- {
- return E_SUCCESS;
- }
-
int textElementIndex = 0;
result r = E_SUCCESS;
TextElement* pTextElement = null;
}
r = pNewBitmap->Construct(*pBitmap, FloatRectangle(0, 0, pBitmap->GetWidthF(), pBitmap->GetHeightF()));
- SysTryCatch(NID_GRP
- , r == E_SUCCESS
- , , r, "[%s] Fails to insert image.", GetErrorMessage(r));
+ SysTryCatch(NID_GRP, r == E_SUCCESS, , r, "[%s] Fails to insert image.", GetErrorMessage(r));
for (int i = 0; i < elementIndex; i++)
{
__pTextObject->Compose();
r = __pLinkedListTextElementList->InsertAt(*pNewBitmap, elementIndex);
- SysTryCatch(NID_GRP
- , r == E_SUCCESS
- , , r, "[%s] Fails to insert image.", GetErrorMessage(r));
+ SysTryCatch(NID_GRP, r == E_SUCCESS, , r, "[%s] Fails to insert image.", GetErrorMessage(r));
if (__isCopiedEnrichedText == false)
{
pNewEnrichedTextImpl = new (std::nothrow)_EnrichedTextImpl(*this);
r = GetLastResult();
- SysTryReturn(NID_GRP
- , pNewEnrichedTextImpl
- , null, r, "[%s] Propagating.", GetErrorMessage(r));
+ SysTryReturn(NID_GRP, pNewEnrichedTextImpl, null, r, "[%s] Propagating.", GetErrorMessage(r));
return pNewEnrichedTextImpl;
}
SysLog(NID_GRP, "[%s] Fail to construct text element.", GetErrorMessage(r));
}
+
+
+ TextElement* pTextElement = null;
+ for (int i = 0; i < __pLinkedListTextElementList->GetCount(); i++)
+ {
+ pTextElement = dynamic_cast < TextElement* >(__pLinkedListTextElementList->GetAt(i));
+ if (pTextElement == null) //Bitmap
+ {
+ Bitmap* pBitmap = dynamic_cast < Bitmap* >(pTextElement);
+ SysTryCatch(NID_GRP, pBitmap, , r, "[%s] Fails to get a bitmap.", GetErrorMessage(r));
+
+ Bitmap* pNewBitmap = new (std::nothrow) Bitmap();
+ SysTryCatch(NID_GRP, pNewBitmap, r = E_OUT_OF_MEMORY, r, "[E_OUT_OF_MEMORY] Fail to create a bitmap.");
+
+ r = pNewBitmap->Construct(*pBitmap, FloatRectangle(0, 0, pBitmap->GetWidthF(), pBitmap->GetHeightF()));
+ SysTryCatch(NID_GRP, r == E_SUCCESS, , r, "[%s] Fails to insert image.", GetErrorMessage(r));
+
+ r = __pLinkedListTextElementList->InsertAt(*pNewBitmap, i);
+ SysTryCatch(NID_GRP, r == E_SUCCESS, , r, "[%s] Fails to insert image.", GetErrorMessage(r));
+ }
+ else
+ {
+ TextElement* pNewTextElement = _TextElementImpl::CreateTextElementN(*pTextElement);
+ if (pNewTextElement == null)
+ {
+ int i = 0;
+ i++;
+ }
+ SysTryCatch(NID_GRP, pNewTextElement, r = E_OUT_OF_MEMORY, r, "[E_OUT_OF_MEMORY] Fail to create a TextElement.");
+
+ _TextElementImpl* pTextElementImpl = _TextElementImpl::GetInstance(*pNewTextElement);
+ if (pTextElementImpl == null)
+ {
+ int i = 0;
+ i++;
+ }
+ pTextElementImpl->SetRegisteringEnrichedText(this);
+
+ r = __pLinkedListTextElementList->InsertAt(*pNewTextElement, i);
+ if (__pLinkedListTextElementList == null)
+ {
+ int i = 0;
+ i++;
+ }
+ SysTryCatch(NID_GRP, r == E_SUCCESS, , r, "[%s] Fails to insert TextElement.", GetErrorMessage(r));
+ }
+ }
+
+ return;
+
+CATCH:
+ if (__pLinkedListTextElementList)
+ {
+ __pLinkedListTextElementList->RemoveAll(true);
+ delete __pLinkedListTextElementList;
+ __pLinkedListTextElementList = null;
+ }
+
+ if (__pTextElement)
+ {
+ delete __pTextElement;
+ __pTextElement = null;
+ }
}
_EnrichedTextImpl*