X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Ftext%2Ftext-geometry.cpp;h=6f173cb880ec74fa14a9dc82fee5b5927fb3dc1e;hb=c58c49ba4b68d3e398defe6da67a3f5393cd8ee2;hp=bde55178bc34fdbb74841cdd9ef030337dc025f2;hpb=b7e3a56ad86f6f45b9cd126647a6161757c3674e;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/text/text-geometry.cpp b/dali-toolkit/internal/text/text-geometry.cpp index bde5517..6f173cb 100644 --- a/dali-toolkit/internal/text/text-geometry.cpp +++ b/dali-toolkit/internal/text/text-geometry.cpp @@ -68,14 +68,29 @@ 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; + //Clear the lists + sizesList.Clear(); + positionsList.Clear(); + + if(charactersToGlyphBuffer == nullptr || glyphsPerCharacterBuffer == nullptr || charactersPerGlyphBuffer == nullptr || glyphToCharacterBuffer == nullptr ) + { + return; + } + if(startIndex >= logicalModel->mText.Count() && endIndex >= logicalModel->mText.Count()) + { return; + } if(startIndex >= logicalModel->mText.Count()) + { startIndex = logicalModel->mText.Count() - 1; + } if(endIndex >= logicalModel->mText.Count()) + { endIndex = logicalModel->mText.Count() - 1; + } if(startIndex > endIndex) { @@ -160,7 +175,7 @@ void GetTextGeometry(ModelPtr textModel, CharacterIndex startIndex, CharacterInd } else { - if((ellipsisPosition == DevelText::EllipsisPosition::END) && (index >= endIndexOfGlyphs)) + if((ellipsisPosition == DevelText::EllipsisPosition::END) && (index > endIndexOfGlyphs)) { //skip remaining elided glyphs break;