From: Eunki, Hong Date: Wed, 15 Dec 2021 02:48:46 +0000 (+0900) Subject: Fix svace issue on text-geometry (unsigned int < 0) X-Git-Tag: dali_2.1.3~5 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=commitdiff_plain;h=59d90a3372e69123a1c0f11b998cd0d94c0abc82 Fix svace issue on text-geometry (unsigned int < 0) CharacterIndex type is unsigned int. So it cannot be negative Change-Id: I9f9c6868f103ee45695a4fd87dc4cafd0819f471 Signed-off-by: Eunki, Hong --- diff --git a/dali-toolkit/internal/text/text-geometry.cpp b/dali-toolkit/internal/text/text-geometry.cpp index e599922..9fa5ad1 100644 --- a/dali-toolkit/internal/text/text-geometry.cpp +++ b/dali-toolkit/internal/text/text-geometry.cpp @@ -67,15 +67,9 @@ void GetTextGeometry(ModelPtr textModel, CharacterIndex startIndex, CharacterInd const CharacterIndex* const glyphToCharacterBuffer = visualModel->mGlyphsToCharacters.Begin(); const CharacterDirection* const modelCharacterDirectionsBuffer = (0u != logicalModel->mCharacterDirections.Count()) ? logicalModel->mCharacterDirections.Begin() : NULL; - if((startIndex < 0 && endIndex < 0) || (startIndex >= logicalModel->mText.Count() && endIndex >= logicalModel->mText.Count())) + if(startIndex >= logicalModel->mText.Count() && endIndex >= logicalModel->mText.Count()) return; - if(startIndex < 0) - startIndex = 0; - - if(endIndex < 0) - endIndex = 0; - if(startIndex >= logicalModel->mText.Count()) startIndex = logicalModel->mText.Count() - 1;