fix bug for APIs using coordinate
authorSeongjun Yim <se201.yim@samsung.com>
Wed, 15 May 2013 14:27:56 +0000 (23:27 +0900)
committerSeongjun Yim <se201.yim@samsung.com>
Wed, 15 May 2013 14:34:26 +0000 (23:34 +0900)
Change-Id: Iaebe6ba998e9628679c3cf1901b9704570eca67f
Signed-off-by: Seongjun Yim <se201.yim@samsung.com>
src/controls/FWebCtrl_WebImpl.cpp

index 000dcdd..d37deec 100755 (executable)
@@ -72,6 +72,7 @@
 #include <FBase_StringConverter.h>
 #include <FCnt_DownloadManagerImpl.h>
 #include <FGrp_CoordinateSystem.h>
+#include <FGrp_Screen.h>
 #include <FIo_DatabaseImpl.h>
 #include <FIo_NormalFile.h>
 #include <FSys_VibratorImpl.h>
@@ -2876,6 +2877,15 @@ _WebImpl::GetSetting(void) const
 const HitElementResult*
 _WebImpl::GetElementByPointN(const Point& point) const
 {
+       return GetElementByPointN(_CoordinateSystemUtils::ConvertToFloat(point));
+}
+
+
+const HitElementResult*
+_WebImpl::GetElementByPointN(const FloatPoint& point) const
+{
+       SysTryReturn(NID_WEB_CTRL, Contains(point), null, E_INVALID_ARG, "[%s] The point must be contained in the bounds of a web control.", GetErrorMessage(E_INVALID_ARG));
+
        result r = E_SUCCESS;
 
        _HitElementResultImpl* pHitElementResultImpl = null;
@@ -2884,7 +2894,7 @@ _WebImpl::GetElementByPointN(const Point& point) const
        std::unique_ptr<Bitmap> pImage;
        std::unique_ptr<HashMap, AllElementsDeleter> pAttributeMap;
 
-       Point absPoint(__pWebCore->GetAbsoluteCoordinate(point));
+       Point absPoint(_CoordinateSystemUtils::ConvertToInteger(__pWebCore->GetAbsoluteCoordinate(point)));
 
        Ewk_Hit_Test* pEwkHitTest = ewk_view_hit_test_new(__pWebCore->GetWebNativeNode(), absPoint.x, absPoint.y, EWK_HIT_TEST_MODE_ALL);
        SysTryReturn(NID_WEB_CTRL, pEwkHitTest, null, E_SYSTEM, "[%s] Failed to get hit test.", GetErrorMessage(E_SYSTEM));
@@ -2978,18 +2988,6 @@ CATCH:
 }
 
 
-const HitElementResult*
-_WebImpl::GetElementByPointN(const FloatPoint& point) const
-{
-       const Point integerPoint(_CoordinateSystemUtils::ConvertToInteger(point));
-
-       std::unique_ptr<const HitElementResult> pHitElementResult(GetElementByPointN(integerPoint));
-       SysTryReturn(NID_WEB_CTRL, pHitElementResult.get(), null, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
-
-       return pHitElementResult.release();
-}
-
-
 bool
 _WebImpl::IsLoading(void) const
 {
@@ -3547,12 +3545,19 @@ _WebImpl::RemoveEventListenerCallback(void) const
 result
 _WebImpl::SetBlockSelectionPosition(const Point& startPoint)
 {
+       return SetBlockSelectionPosition(_CoordinateSystemUtils::ConvertToFloat(startPoint));
+}
+
+
+result
+_WebImpl::SetBlockSelectionPosition(const FloatPoint& startPoint)
+{
        Evas_Object* pWebNativeNode = __pWebCore->GetWebNativeNode();
 
        Ewk_View_Smart_Data* pSmartData = (Ewk_View_Smart_Data*) evas_object_smart_data_get(pWebNativeNode);
        SysAssertf(pSmartData, "Failed to request");
 
-       Point absPoint(__pWebCore->GetAbsoluteCoordinate(startPoint));
+       Point absPoint( _CoordinateSystemUtils::ConvertToInteger(__pWebCore->GetAbsoluteCoordinate(startPoint)));
 
        Eina_Bool ret = pSmartData->api->text_selection_down(pSmartData, absPoint.x, absPoint.y);
        if (ret)
@@ -3585,13 +3590,6 @@ _WebImpl::SetBlockSelectionPosition(const Point& startPoint)
 }
 
 
-result
-_WebImpl::SetBlockSelectionPosition(const FloatPoint& startPoint)
-{
-       return SetBlockSelectionPosition(_CoordinateSystemUtils::ConvertToInteger(startPoint));
-}
-
-
 void
 _WebImpl::ReleaseBlock(void)
 {