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)
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;