From: Syed Khaja Moinuddin Date: Tue, 30 Apr 2013 02:43:37 +0000 (+0900) Subject: Fixed prevent issue in EditTime. X-Git-Tag: submit/tizen_2.1/20130514.054411~137 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b021c7f204336ffeed3be7b0e1cd557f1ce52e76;p=framework%2Fosp%2Fuifw.git Fixed prevent issue in EditTime. Signed-off-by: Syed Khaja Moinuddin Change-Id: I72494acd3e10802a8daee5279b3b572bee814036 Signed-off-by: Syed Khaja Moinuddin --- diff --git a/src/ui/controls/FUiCtrl_EditTime.cpp b/src/ui/controls/FUiCtrl_EditTime.cpp index f025121..0255708 100644 --- a/src/ui/controls/FUiCtrl_EditTime.cpp +++ b/src/ui/controls/FUiCtrl_EditTime.cpp @@ -489,7 +489,7 @@ _EditTime::OnDraw(void) __pEditTimePresenter->Draw(); - if(likely((_AccessibilityManager::IsActivated()))) + if(unlikely((_AccessibilityManager::IsActivated()))) { UpdateAccessibilityElement(); } @@ -556,23 +556,19 @@ _EditTime::OnBoundsChanged(void) __pEditTimePresenter->Initialize(); - if (__pAccessibilityEditTimeElement) - { - __pAccessibilityEditTimeElement->SetBounds(GetClientBoundsF()); - } + SysTryReturnVoidResult(NID_UI_CTRL, (__pAccessibilityEditTimeElement != null), E_SYSTEM, "[E_SYSTEM] A system error has occurred. EditTime accessibility element must not be null."); + SysTryReturnVoidResult(NID_UI_CTRL, (__pAccessibilityHourElement != null), E_SYSTEM, "[E_SYSTEM] A system error has occurred. Hour accessibility element must not be null."); + SysTryReturnVoidResult(NID_UI_CTRL, (__pAccessibilityMinuteElement != null), E_SYSTEM, "[E_SYSTEM] A system error has occurred. Minute accessibility element must not be null."); + + __pAccessibilityEditTimeElement->SetBounds(GetClientBoundsF()); FloatRectangle hourBounds = __pEditTimePresenter->GetDisplayAreaBoundsFromHoursStyle(DATETIME_ID_HOUR); FloatRectangle minuteBounds = __pEditTimePresenter->GetDisplayAreaBoundsFromHoursStyle(DATETIME_ID_MINUTE); FloatRectangle ampmBounds = __pEditTimePresenter->GetDisplayAreaBoundsFromHoursStyle(DATETIME_ID_AMPM); - if (__pAccessibilityHourElement) - { - __pAccessibilityHourElement->SetBounds(hourBounds); - } - if (__pAccessibilityMinuteElement) - { - __pAccessibilityMinuteElement->SetBounds(minuteBounds); - } + __pAccessibilityHourElement->SetBounds(hourBounds); + __pAccessibilityMinuteElement->SetBounds(minuteBounds); + if (__pAccessibilityAmPmElement) { __pAccessibilityHourElement->SetBounds(FloatRectangle(hourBounds.x, ampmBounds.y, hourBounds.width, ampmBounds.height)); @@ -818,11 +814,9 @@ _EditTime::UpdateAccessibilityElement(void) String string; - if (__pAccessibilityEditTimeElement == null && __pAccessibilityHourElement == null - && __pAccessibilityMinuteElement == null) - { - return; - } + SysTryReturnVoidResult(NID_UI_CTRL, (__pAccessibilityEditTimeElement != null), E_SYSTEM, "[E_SYSTEM] A system error has occurred. EditTime accessibility element must not be null."); + SysTryReturnVoidResult(NID_UI_CTRL, (__pAccessibilityHourElement != null), E_SYSTEM, "[E_SYSTEM] A system error has occurred. Hour accessibility element must not be null."); + SysTryReturnVoidResult(NID_UI_CTRL, (__pAccessibilityMinuteElement != null), E_SYSTEM, "[E_SYSTEM] A system error has occurred. Minute accessibility element must not be null."); if (__title.IsEmpty() == false) { @@ -855,8 +849,9 @@ _EditTime::UpdateAccessibilityElement(void) if (Is24HourNotationEnabled() == false) { _AccessibilityContainer* pContainer = GetAccessibilityContainer(); + SysTryReturnVoidResult(NID_UI_CTRL, (pContainer != null), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult())); - if (pContainer != null && __pAccessibilityAmPmElement == null) + if (__pAccessibilityAmPmElement == null) { __pAccessibilityAmPmElement = new (std::nothrow) _AccessibilityElement(true); SysTryReturnVoidResult(NID_UI_CTRL, (__pAccessibilityAmPmElement != null), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult())); @@ -868,7 +863,7 @@ _EditTime::UpdateAccessibilityElement(void) __pAccessibilityHourElement->SetBounds(FloatRectangle(hourBounds.x, ampmBounds.y, hourBounds.width, ampmBounds.height)); __pAccessibilityMinuteElement->SetBounds(FloatRectangle(minuteBounds.x, ampmBounds.y, minuteBounds.width, ampmBounds.height)); } - else if (__pAccessibilityAmPmElement != null) + else { __pAccessibilityAmPmElement->Activate(true); }