Added exception when the argument is invalid
authorYunji Park <yunji19.park@samsung.com>
Mon, 9 Sep 2013 06:48:07 +0000 (15:48 +0900)
committerYunji Park <yunji19.park@samsung.com>
Mon, 9 Sep 2013 06:48:07 +0000 (15:48 +0900)
Change-Id: Id8c28cc83968b4e3b0bb5596a665394993988d92

src/graphics/text/FGrp_TextTextObject.cpp

index b8ac36a..3e4f578 100644 (file)
@@ -3562,7 +3562,7 @@ TextObject::GetTextPositionInfoInWrapAt(int row, int column, float& width, float
        float lineY = lineBounds.y;
 
        SysTryReturn(NID_GRP, lineOffset <= textIndex && textIndex <= lineOffset + lineLength
-               , E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid. (row = %d column = %d)", row, column);
+               , E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid. (row = %d, column = %d)", row, column);
 
        FloatDimension lineTextSize;
        pTextLine->GetRegion(0, lineLength, lineTextSize.width, lineTextSize.height);
@@ -3954,6 +3954,8 @@ TextObject::GetTextPositionInfoInNoneWrapAt(int row, int column, float& width, f
        float posX = 0.0f;
        float posY = 0.0f;
 
+       SysTryReturn(NID_GRP, 0 <= column && column <= lineLength, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid. (row = %d, column = %d)", row, column);
+
        _FontImpl* pFont = _FontImpl::GetInstance(*__pDefaultFont);
        SysTryReturn(NID_GRP, pFont, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get native font instance.");