add patch
[framework/osp/web.git] / src / FWeb_WebBookmarkImpl.cpp
index 2b7632e..f456449 100755 (executable)
@@ -29,6 +29,7 @@
 #include <FWebBookmarkItem.h>
 #include <FWebWebBookmark.h>
 #include <FBase_StringConverter.h>
+#include <FUiCtrlFrame.h>
 #include "FWeb_BookmarkItemImpl.h"
 #include "FWeb_WebBookmarkImpl.h"
 #include "FWebCtrl_Utility.h"
@@ -36,6 +37,7 @@
 
 using namespace Tizen::Base;
 using namespace Tizen::Graphics;
+using namespace Tizen::Ui::Controls;
 using namespace Tizen::Web::Controls;
 
 
@@ -70,6 +72,7 @@ _WebBookmarkImpl::_WebBookmarkImpl(void)
 
 _WebBookmarkImpl::~_WebBookmarkImpl(void)
 {
+       __bookmarkList.RemoveAll(true);
 }
 
 
@@ -144,32 +147,45 @@ _WebBookmarkImpl::SetFavicon(RecordId bookmarkId, const Bitmap& favicon)
        SysTryReturnResult(NID_WEB, favicon.GetPixelColorFormat() == BITMAP_PIXEL_FORMAT_ARGB8888, E_INVALID_DATA, "The pixel format of a favicon must be ARGB8888");
 
        result r = E_SUCCESS;
+       Frame* pFrame = null;
+
+       BufferInfo bufferInfo;
+       int ret = 0;
+
+       Evas_Object* pIcon = null;
 
-       Evas* pEvas = _Utility::GetEvasFromUiApp();
-       SysTryReturn(NID_WEB, pEvas, GetLastResult(), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
+       Bitmap& temp = const_cast< Bitmap& >(favicon);
+
+       Evas* pEvas = _Utility::GetEvasFromUiApp(pFrame);
+       SysTryCatch(NID_WEB, pEvas, r = GetLastResult(), r, "[%s] Propagating.", GetErrorMessage(r));
 
-       Evas_Object* pIcon = evas_object_image_filled_add(pEvas);
+        pIcon = evas_object_image_filled_add(pEvas);
        evas_object_image_colorspace_set(pIcon, EVAS_COLORSPACE_ARGB8888);
        evas_object_image_filled_set(pIcon, EINA_TRUE);
        evas_object_image_alpha_set(pIcon,EINA_TRUE);
 
-       Bitmap& temp = const_cast< Bitmap& >(favicon);
-
-       BufferInfo bufferInfo;
        r = temp.Lock(bufferInfo);
-       SysTryReturn(NID_WEB, r == E_SUCCESS, r, r, "[%s] Propagating.", r);
+       SysTryCatch(NID_WEB, r == E_SUCCESS, , r, "[%s] Propagating.", r);
 
        evas_object_image_size_set(pIcon, bufferInfo.width, bufferInfo.height);
        evas_object_image_fill_set(pIcon, 0, 0, bufferInfo.width, bufferInfo.height);
        evas_object_image_data_set(pIcon, bufferInfo.pPixels);
 
        r = temp.Unlock();
-       SysTryReturn(NID_WEB, r == E_SUCCESS, r, r, "[%s] Propagating.", r);
+       SysTryCatch(NID_WEB, r == E_SUCCESS, , r, "[%s] Propagating.", r);
 
-       int ret = favorites_bookmark_set_favicon(bookmarkId, pIcon);
-       SysTryReturn(NID_WEB, ret == FAVORITES_ERROR_NONE, ConvertErrorCode(ret), ConvertErrorCode(ret), "[%s] Propagating.", GetErrorMessage(ConvertErrorCode(ret)));
+       ret = favorites_bookmark_set_favicon(bookmarkId, pIcon);
+       SysTryCatch(NID_WEB, ret == FAVORITES_ERROR_NONE, r = ConvertErrorCode(ret), r, "[%s] Propagating.", GetErrorMessage(r));
+
+
+       delete pFrame;
 
        return E_SUCCESS;
+
+CATCH:
+       delete pFrame;
+
+       return r;
 }