Fix for keypad callback logic
authorHyun Lee <hyunn.lee@samsung.com>
Thu, 11 Apr 2013 01:49:01 +0000 (10:49 +0900)
committerHyun Lee <hyunn.lee@samsung.com>
Thu, 11 Apr 2013 01:49:01 +0000 (10:49 +0900)
Change-Id: I6270ab8295293a90d77bbc26fb6c970462080c5a
Signed-off-by: Hyun Lee <hyunn.lee@samsung.com>
src/controls/FWebCtrl_WebImpl.cpp

index 218f83b..c52d4d5 100755 (executable)
@@ -1616,12 +1616,15 @@ OnWebKeypadStateChanged(void* pUserData, Evas_Object* pView, void* pEventInfo)
                }
 
                _Form* pFormCore = pImpl->GetParentFormCore(dynamic_cast< _Control* >(&pImpl->GetCore()));
-               SysAssertf(pFormCore != null, "Failed to get FormCore");
-
-               if (pFormCore->HasFooter() && pFormCore->IsFooterVisible())
+               if (pFormCore)
                {
-                       pImpl->SetFooterVisibleState(true);
-                       pFormCore->SetActionBarsVisible(FORM_ACTION_BAR_FOOTER, false);
+                       if (pFormCore->HasFooter() && pFormCore->IsFooterVisible())
+                       {
+                               pImpl->SetFooterVisibleState(true);
+                               pFormCore->SetActionBarsVisible(FORM_ACTION_BAR_FOOTER, false);
+                       }
+
+                       pFormCore->DeflateClientRectHeight(pXformer->TransformVertical(rect.height));
                }
 
                if (pImpl->GetWebKeypadEventListener())
@@ -1635,7 +1638,6 @@ OnWebKeypadStateChanged(void* pUserData, Evas_Object* pView, void* pEventInfo)
                        }
                        else
                        {
-                               pFormCore->DeflateClientRectHeight(pXformer->TransformVertical(rect.height));
                                pImpl->GetWebKeypadEventListener()->OnWebKeypadWillOpen(*dynamic_cast< Web* >(&pImpl->GetPublic()));
                        }
                }
@@ -1669,18 +1671,19 @@ OnWebKeypadClosed(void* pUserData, Evas_Object* pView, void* pEventInfo)
        _WebImpl* pImpl = reinterpret_cast< _WebImpl* >(pUserData);
        SysAssertf(pImpl, "Failed to request");
 
-       _Form* pFormCore = pImpl->GetParentFormCore(dynamic_cast< _Control* >(&pImpl->GetCore()));
-       SysAssertf(pFormCore != null, "Failed to get FormCore");
-
        if (pImpl->IsKeypadVisible())
        {
-               if (pFormCore->HasFooter() && pImpl->IsFooterVisible())
+               _Form* pFormCore = pImpl->GetParentFormCore(dynamic_cast< _Control* >(&pImpl->GetCore()));
+               if (pFormCore)
                {
-                       pImpl->SetFooterVisibleState(false);
-                       pFormCore->SetActionBarsVisible(FORM_ACTION_BAR_FOOTER, true);
-               }
+                       if (pFormCore->HasFooter() && pImpl->IsFooterVisible())
+                       {
+                               pImpl->SetFooterVisibleState(false);
+                               pFormCore->SetActionBarsVisible(FORM_ACTION_BAR_FOOTER, true);
+                       }
 
-               pFormCore->DeflateClientRectHeight(0);
+                       pFormCore->DeflateClientRectHeight(0);
+               }
 
                if (pImpl->GetWebKeypadEventListener())
                {
@@ -2126,9 +2129,6 @@ _WebImpl::InitializeSetting(void)
 
        SetEventListenerCallback();
 
-       _Form* pFormCore = GetParentFormCore(dynamic_cast< _Control* >(&this->GetCore()));
-       SysAssertf(pFormCore != null, "Failed to get FormCore");
-
        return E_SUCCESS;
 }
 
@@ -4324,24 +4324,13 @@ _WebImpl::GetParentFormCore(_Control* pControlCore)
        _Form* pFormCore = null;
 
        _Control* pParentControlCore = dynamic_cast< _Control* >(pControlCore->GetParent());
-
-       if (pParentControlCore == null)
-       {
-               _Window* pWindowCore = dynamic_cast< _Window* >(pControlCore);
-               SysAssertf(pWindowCore, "Failed to get parent control and window core.");
-               pFormCore = dynamic_cast< _Form* >(pWindowCore->GetOwner());
-               if (pFormCore == null)
-               {
-                       pParentControlCore = dynamic_cast< _Control* >(pWindowCore->GetOwner());
-                       SysTryReturn(NID_WEB_CTRL, pParentControlCore, null, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
-               }
-       }
-       else
+       if (!pParentControlCore)
        {
-               pFormCore = dynamic_cast< _Form* >(pParentControlCore);
+               return null;
        }
 
-       if (pFormCore != null)
+       pFormCore = dynamic_cast< _Form* >(pParentControlCore);
+       if (pFormCore)
        {
                return pFormCore;
        }
@@ -4417,9 +4406,10 @@ _WebImpl::OnChangeLayout(_ControlOrientation orientation)
                ecore_imf_context_input_panel_geometry_get(ecore_imf_context_add(ecore_imf_context_default_id_get()), &x, &y, &w, &h);
 
                _Form* pFormCore = GetParentFormCore(dynamic_cast< _Control* >(&this->GetCore()));
-               SysAssertf(pFormCore != null, "Failed to get FormCore");
-
-               pFormCore->DeflateClientRectHeight(h);
+               if (pFormCore)
+               {
+                       pFormCore->DeflateClientRectHeight(h);
+               }
        }
 
        if (__pColorPicker.get())