Label Margin accepts 0
authorAyush <ayush.sriv@samsung.com>
Wed, 30 Oct 2013 05:07:55 +0000 (10:37 +0530)
committerAyush <ayush.sriv@samsung.com>
Wed, 30 Oct 2013 06:21:45 +0000 (11:51 +0530)
Change-Id: Id00035a94ec8b7a325d6e4ccbd8dde5d0b7efe08
Signed-off-by: Ayush <ayush.sriv@samsung.com>
inc/FUiCtrlLabel.h
src/ui/controls/FUiCtrl_LabelImpl.cpp

index e505445..4fa53d1 100644 (file)
@@ -345,6 +345,7 @@ public:
         * @exception   E_INVALID_ARG     Either of the following conditions has occurred:
         *                                                                - A specified input parameter is invalid.
         *                                                                - The specified @c size must be greater than @c 0.
+        * @remarks     The margin values must be greater than or equal to 0.
         * @see                           GetTopMargin()
         * @see                                                   GetLeftMargin()
         */
@@ -362,6 +363,7 @@ public:
         * @exception   E_INVALID_ARG     Either of the following conditions has occurred:
         *                                                                - The specified input parameter is invalid.
         *                                                                - The specified @c size must be greater than @c 0.
+        * @remarks     The margin values must be greater than or equal to 0.0f
         * @see                           GetTopMargin()
         * @see                                                   GetLeftMargin()
         */
index edac268..6969766 100644 (file)
@@ -266,7 +266,9 @@ _LabelImpl::SetTextConfig(float size, LabelTextStyle style)
 result
 _LabelImpl::SetMargin(int topMargin, int leftMargin)
 {
-//     SysTryReturn(NID_UI_CTRL, (topMargin > 0 && leftMargin > 0), E_INVALID_ARG, E_INVALID_ARG, "The margin values should be greater than 0", GetErrorMessage(E_INVALID_ARG));
+       topMargin = topMargin < 0 ? 0 : topMargin;
+       leftMargin = leftMargin < 0 ? 0 : leftMargin;
+
        result r = GetCore().SetMargin(topMargin, leftMargin);
        SetLastResultReturn(r);
 }
@@ -274,7 +276,9 @@ _LabelImpl::SetMargin(int topMargin, int leftMargin)
 result
 _LabelImpl::SetMargin(float topMargin, float leftMargin)
 {
-//     SysTryReturn(NID_UI_CTRL, (topMargin > 0.0f && leftMargin > 0.0f), E_INVALID_ARG, E_INVALID_ARG, "The margin values should be greater than 0.0f", GetErrorMessage(E_INVALID_ARG));
+       topMargin = topMargin < 0.0f ? 0.0f : topMargin;
+       leftMargin = leftMargin < 0.0f ? 0.0f : leftMargin;
+
        result r = GetCore().SetMargin(topMargin, leftMargin);
        SetLastResultReturn(r);
 }