ClearLastResult();
// Parse UiBuilder XML file
- unique_ptr<_UiBuilder> pBuilder(new _UiBuilder());
+ unique_ptr<_UiBuilder> pBuilder(new (std::nothrow) _UiBuilder());
SysTryReturnResult(NID_UI_CTRL, pBuilder, E_OUT_OF_MEMORY, "Memory allocation failed.");
result r = pBuilder->Construct(resourceId, this);
SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
ClearLastResult();
// Parse UiBuilder XML file
- unique_ptr<_UiBuilder> pBuilder(new _UiBuilder());
+ unique_ptr<_UiBuilder> pBuilder(new (std::nothrow) _UiBuilder());
SysTryReturn(NID_UI_CTRL, pBuilder, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is insufficient.");
result r = pBuilder->Construct(resourceId, this);
SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
ClearLastResult();
// Parse UiBuilder XML file
- unique_ptr<_UiBuilder> pBuilder(new _UiBuilder());
+ unique_ptr<_UiBuilder> pBuilder(new (std::nothrow) _UiBuilder());
SysTryReturnResult(NID_UI_CTRL, pBuilder != null, E_OUT_OF_MEMORY, "Memory allocation failed.");
result r = pBuilder->Construct(resourceId, this);
FloatRectangle monthBounds = __pEditDatePresenter->GetDateAreaBounds(DATETIME_ID_MONTH);
FloatRectangle yearBounds = __pEditDatePresenter->GetDateAreaBounds(DATETIME_ID_YEAR);
+ _DateTimeUtils dateTimeUtils;
+ int localeDateFormat = dateTimeUtils.GetLocaleDateFormat();
+
if (__pAccessibilityEditDateElement == null)
{
- __pAccessibilityEditDateElement = new _AccessibilityElement(true);
+ __pAccessibilityEditDateElement = new (std::nothrow) _AccessibilityElement(true);
+ SysTryReturnVoidResult(NID_UI_CTRL, __pAccessibilityEditDateElement != null, E_OUT_OF_MEMORY,
+ "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
+
__pAccessibilityEditDateElement->SetBounds(GetClientBoundsF());
__pAccessibilityEditDateElement->SetTrait(ACCESSIBILITY_TRAITS_NONE);
__pAccessibilityEditDateElement->SetName("EditDateText");
if (__pAccessibilityYearElement == null && __pAccessibilityMonthElement == null && __pAccessibilityDayElement == null)
{
- __pAccessibilityYearElement = new _AccessibilityElement(true);
+ __pAccessibilityYearElement = new (std::nothrow) _AccessibilityElement(true);
+ SysTryReturnVoidResult(NID_UI_CTRL, __pAccessibilityYearElement != null, E_OUT_OF_MEMORY,
+ "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
+
__pAccessibilityYearElement->SetBounds(yearBounds);
__pAccessibilityYearElement->SetTraitWithStringId("IDS_TPLATFORM_BODY_YEAR_LC");
__pAccessibilityYearElement->SetHintWithStringId("IDS_TPLATFORM_BODY_DOUBLE_TAP_TO_EDIT_T_TTS");
- __pAccessibilityMonthElement = new _AccessibilityElement(true);
+ __pAccessibilityMonthElement = new (std::nothrow) _AccessibilityElement(true);
+ SysTryCatch(NID_UI_CTRL, __pAccessibilityMonthElement != null, , E_OUT_OF_MEMORY,
+ "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
+
__pAccessibilityMonthElement->SetBounds(monthBounds);
__pAccessibilityMonthElement->SetTraitWithStringId("IDS_TPLATFORM_BODY_MONTH_LC");
__pAccessibilityMonthElement->SetHintWithStringId("IDS_TPLATFORM_BODY_DOUBLE_TAP_TO_EDIT_T_TTS");
- __pAccessibilityDayElement = new _AccessibilityElement(true);
+ __pAccessibilityDayElement = new (std::nothrow) _AccessibilityElement(true);
+ SysTryCatch(NID_UI_CTRL, __pAccessibilityDayElement != null, , E_OUT_OF_MEMORY,
+ "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
+
__pAccessibilityDayElement->SetBounds(dayBounds);
__pAccessibilityDayElement->SetTraitWithStringId("IDS_TPLATFORM_BODY_DAY_LC");
__pAccessibilityDayElement->SetHintWithStringId("IDS_TPLATFORM_BODY_DOUBLE_TAP_TO_EDIT_T_TTS");
- _DateTimeUtils dateTimeUtils;
- int localeDateFormat = dateTimeUtils.GetLocaleDateFormat();
-
switch (localeDateFormat)
{
case DATE_FORMAT_DDMMYYYY:
}
UpdateAccessibilityElement();
}
+
+ return;
+
+CATCH:
+ delete __pAccessibilityYearElement;
+ __pAccessibilityYearElement = null;
+
+ delete __pAccessibilityMonthElement;
+ __pAccessibilityMonthElement = null;
+
+ return;
}
void
pContainer->AddListener(*this);
if (__pAccessibilityEditTimeElement == null)
{
- __pAccessibilityEditTimeElement = new _AccessibilityElement(true);
+ __pAccessibilityEditTimeElement = new (std::nothrow) _AccessibilityElement(true);
+ SysTryReturnVoidResult(NID_UI_CTRL, __pAccessibilityEditTimeElement != null, E_OUT_OF_MEMORY,
+ "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
+
__pAccessibilityEditTimeElement->SetBounds(GetClientBoundsF());
__pAccessibilityEditTimeElement->SetTrait(ACCESSIBILITY_TRAITS_NONE);
__pAccessibilityEditTimeElement->SetName(L"EditTimeText");
if (__pAccessibilityHourElement == null && __pAccessibilityMinuteElement == null)
{
- __pAccessibilityHourElement = new _AccessibilityElement(true);
+ __pAccessibilityHourElement = new (std::nothrow) _AccessibilityElement(true);
+ SysTryReturnVoidResult(NID_UI_CTRL, __pAccessibilityHourElement != null, E_OUT_OF_MEMORY,
+ "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
+
__pAccessibilityHourElement->SetBounds(hourBounds);
__pAccessibilityHourElement->SetTraitWithStringId("IDS_TPLATFORM_BODY_HOUR_LC");
__pAccessibilityHourElement->SetHintWithStringId("IDS_TPLATFORM_BODY_DOUBLE_TAP_TO_EDIT_T_TTS");
pContainer->AddElement(*__pAccessibilityHourElement);
- __pAccessibilityMinuteElement = new _AccessibilityElement(true);
+ __pAccessibilityMinuteElement = new (std::nothrow) _AccessibilityElement(true);
+ SysTryReturnVoidResult(NID_UI_CTRL, __pAccessibilityMinuteElement != null, E_OUT_OF_MEMORY,
+ "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
+
__pAccessibilityMinuteElement->SetBounds(minuteBounds);
__pAccessibilityMinuteElement->SetTraitWithStringId("IDS_TPLATFORM_BODY_MINUTE_LC");
__pAccessibilityMinuteElement->SetHintWithStringId("IDS_TPLATFORM_BODY_DOUBLE_TAP_TO_EDIT_T_TTS");
if (!Is24HourNotationEnabled())
{
- __pAccessibilityAmPmElement = new _AccessibilityElement(true);
+ __pAccessibilityAmPmElement = new (std::nothrow) _AccessibilityElement(true);
+ SysTryReturnVoidResult(NID_UI_CTRL, __pAccessibilityAmPmElement != null, E_OUT_OF_MEMORY,
+ "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
+
__pAccessibilityAmPmElement->SetBounds(ampmBounds);
__pAccessibilityAmPmElement->SetTraitWithStringId("IDS_TPLATFORM_BODY_BUTTON_T_TTS");
pContainer->AddElement(*__pAccessibilityAmPmElement);
item.__pCustomListItemImpl->itemId = itemId;
- Boolean* pIsExpanded = new Boolean(false);
+ Boolean* pIsExpanded = new (std::nothrow) Boolean(false);
SysTryReturn(NID_UI_CTRL, pIsExpanded, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
__groupExpandStateList.InsertAt(*pIsExpanded, mainIndex);
{
SysTryReturnResult(NID_UI_CTRL, (mainIndex >= 0 && mainIndex < GetGroupCount()), E_INVALID_ARG, "Invalid argument used. mainIndex = %d", mainIndex);
- Boolean* pIsExpanded = new Boolean(expand);
+ Boolean* pIsExpanded = new (std::nothrow) Boolean(expand);
SysTryReturn(NID_UI_CTRL, pIsExpanded, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
__groupExpandStateList.SetAt(*pIsExpanded, mainIndex, true);
int returnValue = __pInputPadPresenter->GetReturnValue(index);
if (returnValue >= 0)
{
- _AccessibilityElement* pElement = new _AccessibilityElement(true);
+ _AccessibilityElement* pElement = new (std::nothrow) _AccessibilityElement(true);
if (pElement != null)
{
if (__pInputPadPresenter->GetInputPadStyle() == INPUTPAD_STYLE_ALPHA)
_AccessibilityContainer* pContainer = GetAccessibilityContainer();
if (pContainer != null)
{
- __pAccessibilityElement = new _AccessibilityElement(true);
+ __pAccessibilityElement = new (std::nothrow) _AccessibilityElement(true);
SysTryReturnResult(NID_UI_CTRL, __pAccessibilityElement, E_OUT_OF_MEMORY, "Memory allocation failed.");
__pAccessibilityElement->SetBounds(FloatRectangle(0.0f, 0.0f, GetBounds().width, GetBounds().height));
__pAccessibilityElement->SetName(L"ProgressingImage");