Merge "Change initializing time for SetAccessibilityElement." into tizen_2.1
authoryouseong.ji <youseong.ji@samsung.com>
Thu, 23 May 2013 10:35:15 +0000 (19:35 +0900)
committerGerrit Code Review <gerrit2@kim11>
Thu, 23 May 2013 10:35:15 +0000 (19:35 +0900)
src/ui/controls/FUiCtrl_TableViewItem.cpp

index 505267c..dddca92 100644 (file)
@@ -437,6 +437,11 @@ _TableViewItem::Initialize(void)
 
        SetTouchPressThreshold(SENSITIVE);
 
+       if (!_FloatCompare(__itemHeight, 0.0f))
+       {
+               SetAccessibilityElement();
+       }
+
        return r;
 
 CATCH:
@@ -1941,6 +1946,11 @@ _TableViewItem::OnBoundsChanged(void)
                FloatRectangle bounds = GetBoundsF();
                __pBitmapVisualElement->SetBounds(FloatRectangle(0.0f, 0.0f, bounds.width, bounds.height));
        }
+
+       if(__pAccessibilityElement != null)
+       {
+               __pAccessibilityElement->SetBounds(FloatRectangle(0.0f,0.0f, GetBoundsF().width, GetBoundsF().height));
+       }
 }
 
 void
@@ -4283,36 +4293,31 @@ _TableViewItem::OnVisualElementAnimationFinished(const Tizen::Ui::Animations::Vi
 result
 _TableViewItem::OnAttachedToMainTree(void)
 {
-       result r = E_SUCCESS;
-
        if (!_FloatCompare(GetBoundsF().height, 0.0f))
        {
                SetAccessibilityElement();
        }
 
-       return r;
+       return E_SUCCESS;
 }
 
 void
 _TableViewItem::SetAccessibilityElement(void)
 {
-       if(__pAccessibilityElement)
-       {
-               return ;
-       }
-
        _AccessibilityContainer* pContainer = GetAccessibilityContainer();
-       if(pContainer)
+       if(pContainer != null)
        {
-               __pAccessibilityElement = new (std::nothrow) _AccessibilityElement(true);
-               SysTryReturnVoidResult(NID_UI_CTRL, __pAccessibilityElement, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory shortage.");
+               if(__pAccessibilityElement == null)
+               {
+                       __pAccessibilityElement = new (std::nothrow) _AccessibilityElement(true);
+                       SysTryReturnVoidResult(NID_UI_CTRL, __pAccessibilityElement, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory shortage.");
 
-               FloatRectangle accessibilityRect(0.0f,0.0f, GetBoundsF().width, GetBoundsF().height);
-               __pAccessibilityElement->SetBounds(_CoordinateSystemUtils::ConvertToInteger(accessibilityRect));  // +++ check floating
-               __pAccessibilityElement->SetTrait(ACCESSIBILITY_TRAITS_NONE);
-               __pAccessibilityElement->SetName(L"TableViewItem");
+                       __pAccessibilityElement->SetTrait(ACCESSIBILITY_TRAITS_NONE);
+                       __pAccessibilityElement->SetName(L"TableViewItem");
 
-               pContainer->AddElement(*__pAccessibilityElement);
+                       pContainer->AddElement(*__pAccessibilityElement);
+               }
+               __pAccessibilityElement->SetBounds(FloatRectangle(0.0f,0.0f, GetBoundsF().width, GetBoundsF().height));
        }
 }