GroupContainer exception handling related changes
authorPrakalathan Ponnusamy <prakalath.p@samsung.com>
Mon, 15 Apr 2013 12:21:55 +0000 (17:51 +0530)
committerPrakalathan Ponnusamy <prakalath.p@samsung.com>
Mon, 15 Apr 2013 12:21:55 +0000 (17:51 +0530)
Change-Id: Ifaef398b1a9774ff7040eff3c0770861d1cd3a51

src/ui/controls/FUiCtrl_GroupContainer.cpp

index cd861b7..84d59f1 100644 (file)
@@ -565,11 +565,17 @@ _GroupContainer::GetRowHeight(int rowIndex)
 result
 _GroupContainer::Merge(int rowStartIndex, int columnStartIndex, int rowCount, int columnCount)
 {
+       SysTryReturnResult(NID_UI_CTRL, (rowStartIndex >= 0 && rowStartIndex < __rowCount && columnStartIndex >= 0 && columnStartIndex < __columnCount), E_OUT_OF_RANGE, "rowStartIndex(%d) or columnStartIndex(%d) is out of range.", rowStartIndex, columnStartIndex);
+       SysTryReturnResult(NID_UI_CTRL, (rowCount >= 0 && rowCount < __rowCount && columnCount >= 0 && columnCount < __columnCount), E_OUT_OF_RANGE, "rowCount(%d) or columnCount(%d) is out of range.", rowCount, columnCount);
+
        int rowEndIndex = rowStartIndex + rowCount;
        int columnEndIndex = columnStartIndex + columnCount;
 
-       SysTryReturnResult(NID_UI_CTRL, (rowStartIndex >= 0 && rowStartIndex < __rowCount && rowEndIndex >= 0 && rowEndIndex < __rowCount), E_OUT_OF_RANGE, "rowStartIndex(%d) or rowCount(%d) is out of range.", rowStartIndex, rowCount);
-       SysTryReturnResult(NID_UI_CTRL, (columnStartIndex >= 0 && columnStartIndex < __columnCount && columnEndIndex >= 0 && columnEndIndex < __columnCount), E_OUT_OF_RANGE, "columnStartIndex(%d) or columnCount(%d) is out of range.", columnStartIndex, columnCount);
+       if (rowEndIndex >= __rowCount || columnEndIndex >= __columnCount)
+       {
+               SysLogException(NID_UI_CTRL, E_OUT_OF_RANGE, "[E_OUT_OF_RANGE] The row index or the column index is out of range.");
+               return E_OUT_OF_RANGE;
+       }
 
        //If same combination of cells, return success
        if (__pCellsArray[rowStartIndex][columnStartIndex].isParent)
@@ -987,7 +993,7 @@ _GroupContainer::GetControlCoreAt(int rowIndex, int columnIndex)
 
        if (!pControl)
        {
-               SysLogException(NID_UI, E_INVALID_OPERATION, "[E_INVALID_OPERATION] Failed to get control at specified index.");
+               SysLogException(NID_UI_CTRL, E_INVALID_OPERATION, "[E_INVALID_OPERATION] Failed to get control at specified index.");
        }
 
        return pControl;