Modify to use secure log in FGrp_Util.cpp
authorhoonik.lee <hoonik.lee@samsung.com>
Mon, 29 Apr 2013 03:12:20 +0000 (12:12 +0900)
committerhoonik.lee <hoonik.lee@samsung.com>
Mon, 29 Apr 2013 03:12:20 +0000 (12:12 +0900)
Change-Id: I3f6a04138a66c001ccf8bbe622a05d6cbd9875ed
Signed-off-by: hoonik.lee <hoonik.lee@samsung.com>
src/graphics/util/FGrp_Util.cpp

index af5fba9..986ba3d 100644 (file)
@@ -89,30 +89,23 @@ _Util::Validate(const ::Tizen::Graphics::Rectangle& rtSrc, const ::Tizen::Graphi
        // check 1. is width/height less or equal than 0?
        if (rtSrc.width <= 0 || rtSrc.height <= 0 || rtDest.width <= 0 || rtDest.height <= 0)
        {
-               SysTryReturnResult(NID_GRP, 0, E_OUT_OF_RANGE, "The argument is out of range. (src(w:%d,h:%d), dst(w:%d,h:%d)).\n",
-                                                 rtSrc.width, rtSrc.height, rtDest.width,
-                                                 rtDest.height);
+               SysLogException(NID_GRP, E_OUT_OF_RANGE, "[E_OUT_OF_RANGE] The argument is out of range.");
+               SysSecureTryReturn(NID_GRP, 0, E_OUT_OF_RANGE, E_OUT_OF_RANGE, " (src(w:%d,h:%d), dst(w:%d,h:%d)).\n", rtSrc.width, rtSrc.height, rtDest.width, rtDest.height);
        }
 
        // check 2.     is src exiting outside of dest entirely?
        if (rtSrc.x > rtDest.x + rtDest.width - 1 ||
                rtSrc.x + rtSrc.width - 1 < rtDest.x)
        {
-               SysTryReturnResult(NID_GRP, 0, E_OUT_OF_RANGE,
-                                                 "The argument is out of range. (src(x:%d,y:%d,w:%d,h:%d), dst(x:%d,y:%d,w:%d,h:%d)).\n",
-                                                 rtSrc.x,
-                                                 rtSrc.y, rtSrc.width, rtSrc.height, rtDest.x, rtDest.y, rtDest.width,
-                                                 rtDest.height);
+               SysLogException(NID_GRP, E_OUT_OF_RANGE, "[E_OUT_OF_RANGE] The argument is out of range.");
+               SysSecureTryReturn(NID_GRP, 0, E_OUT_OF_RANGE, E_OUT_OF_RANGE, " (src(x:%d,y:%d,w:%d,h:%d), dst(x:%d,y:%d,w:%d,h:%d)).\n",rtSrc.x, rtSrc.y, rtSrc.width, rtSrc.height, rtDest.x, rtDest.y, rtDest.width, rtDest.height);
        }
 
        if (rtSrc.y > rtDest.y + rtDest.height - 1 ||
                rtSrc.y + rtSrc.height - 1 < rtDest.y)
        {
-               SysTryReturnResult(NID_GRP, 0, E_OUT_OF_RANGE,
-                                                 "The argument is out of range. (src(x:%d,y:%d,w:%d,h:%d), dst(x:%d,y:%d,w:%d,h:%d)).\n",
-                                                 rtSrc.x,
-                                                 rtSrc.y, rtSrc.width, rtSrc.height, rtDest.x, rtDest.y, rtDest.width,
-                                                 rtDest.height);
+               SysLogException(NID_GRP, E_OUT_OF_RANGE, "[E_OUT_OF_RANGE] The argument is out of range.");
+               SysSecureTryReturn(NID_GRP, 0, E_OUT_OF_RANGE, E_OUT_OF_RANGE, " (src(x:%d,y:%d,w:%d,h:%d), dst(x:%d,y:%d,w:%d,h:%d)).\n",rtSrc.x, rtSrc.y, rtSrc.width, rtSrc.height, rtDest.x, rtDest.y, rtDest.width, rtDest.height);
        }
 
        return E_SUCCESS;
@@ -124,23 +117,22 @@ _Util::Validate(const ::Tizen::Graphics::FloatRectangle& rtSrcF, const ::Tizen::
        // check 1. is width/height less or equal than 0?
        if (rtSrcF.width <= 0.0f || rtSrcF.height <= 0.0f || rtDestF.width <= 0.0f || rtDestF.height <= 0.0f)
        {
-               SysTryReturnResult(NID_GRP, 0, E_OUT_OF_RANGE, "The argument is out of range. (src(w:%f,h:%f), dst(w:%f,h:%f)).",
-                                                 rtSrcF.width, rtSrcF.height, rtDestF.width, rtDestF.height);
+               SysLogException(NID_GRP, E_OUT_OF_RANGE, "[E_OUT_OF_RANGE] The argument is out of range.");
+               SysSecureTryReturn(NID_GRP, 0, E_OUT_OF_RANGE, E_OUT_OF_RANGE, " (src(w:%f,h:%f), dst(w:%f,h:%f)).\n", rtSrcF.width, rtSrcF.height, rtDestF.width, rtDestF.height);
        }
 
        // check 2.     is src exiting outside of dest entirely?
        if (rtSrcF.x >= rtDestF.x + rtDestF.width || rtSrcF.x + rtSrcF.width <= rtDestF.x)
        {
-               SysTryReturnResult(NID_GRP, 0, E_OUT_OF_RANGE,
-                                                 "The argument is out of range. (src(x:%f,y:%f,w:%f,h:%f), dst(x:%f,y:%f,w:%f,h:%f)).",
-                                                 rtSrcF.x, rtSrcF.y, rtSrcF.width, rtSrcF.height, rtDestF.x, rtDestF.y, rtDestF.width, rtDestF.height);
+               SysLogException(NID_GRP, E_OUT_OF_RANGE, "[E_OUT_OF_RANGE] The argument is out of range.");
+               SysSecureTryReturn(NID_GRP, 0, E_OUT_OF_RANGE, E_OUT_OF_RANGE, " (src(x:%f,y:%f,w:%f,h:%f), dst(x:%f,y:%f,w:%f,h:%f)).\n", rtSrcF.x, rtSrcF.y, rtSrcF.width, rtSrcF.height, rtDestF.x, rtDestF.y, rtDestF.width, rtDestF.height);
+
        }
 
        if (rtSrcF.y >= rtDestF.y + rtDestF.height || rtSrcF.y + rtSrcF.height <= rtDestF.y)
        {
-               SysTryReturnResult(NID_GRP, 0, E_OUT_OF_RANGE,
-                                                 "The argument is out of range. (src(x:%f,y:%f,w:%f,h:%f), dst(x:%f,y:%f,w:%f,h:%f)).",
-                                                 rtSrcF.x, rtSrcF.y, rtSrcF.width, rtSrcF.height, rtDestF.x, rtDestF.y, rtDestF.width, rtDestF.height);
+               SysLogException(NID_GRP, E_OUT_OF_RANGE, "[E_OUT_OF_RANGE] The argument is out of range.");
+               SysSecureTryReturn(NID_GRP, 0, E_OUT_OF_RANGE, E_OUT_OF_RANGE, " (src(x:%f,y:%f,w:%f,h:%f), dst(x:%f,y:%f,w:%f,h:%f)).\n", rtSrcF.x, rtSrcF.y, rtSrcF.width, rtSrcF.height, rtDestF.x, rtDestF.y, rtDestF.width, rtDestF.height);
        }
 
        return E_SUCCESS;
@@ -149,29 +141,25 @@ _Util::Validate(const ::Tizen::Graphics::FloatRectangle& rtSrcF, const ::Tizen::
 result
 _Util::Validate(const ::Tizen::Graphics::Point& ptSrc, const ::Tizen::Graphics::Rectangle& rtDest)
 {
-       SysTryReturnResult(NID_GRP, rtDest.x <= ptSrc.x &&
-                                         ptSrc.x < rtDest.x + rtDest.width &&
-                                         rtDest.y <= ptSrc.y &&
-                                         ptSrc.y < rtDest.y + rtDest.height,
-                                         E_OUT_OF_RANGE, "The argument is out of range. (src(x:%d,y:%d), dst(x:%d,y:%d,w:%d,h:%d)).\n",
-                                         ptSrc.x, ptSrc.y, rtDest.x, rtDest.y, rtDest.width,
-                                         rtDest.height);
+       if (rtDest.x <= ptSrc.x && ptSrc.x < rtDest.x + rtDest.width && rtDest.y <= ptSrc.y && ptSrc.y < rtDest.y + rtDest.height)
+       {
+               return E_SUCCESS;
+       }
 
-       return E_SUCCESS;
+       SysLogException(NID_GRP, E_OUT_OF_RANGE, "[E_OUT_OF_RANGE] The argument is out of range.");
+       SysSecureTryReturn(NID_GRP, 0, E_OUT_OF_RANGE, E_OUT_OF_RANGE, " (src(x:%d,y:%d), dst(x:%d,y:%d,w:%d,h:%d)).\n", ptSrc.x, ptSrc.y, rtDest.x, rtDest.y, rtDest.width, rtDest.height);
 }
 
 result
 _Util::Validate(const ::Tizen::Graphics::FloatPoint& ptSrcF, const ::Tizen::Graphics::FloatRectangle& rtDestF)
 {
-       SysTryReturnResult(NID_GRP, rtDestF.x <= ptSrcF.x &&
-                                         ptSrcF.x < rtDestF.x + rtDestF.width &&
-                                         rtDestF.y <= ptSrcF.y &&
-                                         ptSrcF.y < rtDestF.y + rtDestF.height,
-                                         E_OUT_OF_RANGE, "The argument is out of range. (src(x:%f,y:%f), dst(x:%f,y:%f,w:%f,h:%f)).\n",
-                                         ptSrcF.x, ptSrcF.y, rtDestF.x, rtDestF.y, rtDestF.width,
-                                         rtDestF.height);
+       if (rtDestF.x <= ptSrcF.x && ptSrcF.x < rtDestF.x + rtDestF.width && rtDestF.y <= ptSrcF.y && ptSrcF.y < rtDestF.y + rtDestF.height)
+       {
+               return E_SUCCESS;
+       }
 
-       return E_SUCCESS;
+       SysLogException(NID_GRP, E_OUT_OF_RANGE, "[E_OUT_OF_RANGE] The argument is out of range.");
+       SysSecureTryReturn(NID_GRP, 0, E_OUT_OF_RANGE, E_OUT_OF_RANGE, " (src(x:%f,y:%f), dst(x:%f,y:%f,w:%f,h:%f)).\n", ptSrcF.x, ptSrcF.y, rtDestF.x, rtDestF.y, rtDestF.width, rtDestF.height);
 }
 
 bool