From: Adeel Kazmi Date: Wed, 15 Mar 2017 16:11:42 +0000 (+0000) Subject: (Text Controller) Remove meaningless check to see if an unsigned int is positive... X-Git-Tag: dali_1.2.31~3 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=commitdiff_plain;h=897c1d5c44231796100a22f0998c30cf675165fc;hp=660728e83fd72194f53642fd74c09db561f88496 (Text Controller) Remove meaningless check to see if an unsigned int is positive or zero Fixes an SVACE error. Change-Id: I8118ffca01eb1921549ae2bc2e4366c1e03984b3 --- diff --git a/dali-toolkit/internal/text/text-controller-impl.cpp b/dali-toolkit/internal/text/text-controller-impl.cpp index 986c4e5..da7d929 100644 --- a/dali-toolkit/internal/text/text-controller-impl.cpp +++ b/dali-toolkit/internal/text/text-controller-impl.cpp @@ -1153,26 +1153,23 @@ void Controller::Impl::OnCursorKeyEvent( const Event& event ) const LineIndex lineIndex = mModel->mVisualModel->GetLineOfCharacter( characterIndex ); const LineIndex previousLineIndex = ( lineIndex > 0 ? lineIndex - 1u : lineIndex ); - if( previousLineIndex >= 0u ) - { - // Retrieve the cursor position info. - CursorInfo cursorInfo; - GetCursorPosition( mEventData->mPrimaryCursorPosition, - cursorInfo ); + // Retrieve the cursor position info. + CursorInfo cursorInfo; + GetCursorPosition( mEventData->mPrimaryCursorPosition, + cursorInfo ); - // Get the line above. - const LineRun& line = *( mModel->mVisualModel->mLines.Begin() + previousLineIndex ); + // Get the line above. + const LineRun& line = *( mModel->mVisualModel->mLines.Begin() + previousLineIndex ); - // Get the next hit 'y' point. - const float hitPointY = cursorInfo.lineOffset - 0.5f * ( line.ascender - line.descender ); + // Get the next hit 'y' point. + const float hitPointY = cursorInfo.lineOffset - 0.5f * ( line.ascender - line.descender ); - // Use the cursor hook position 'x' and the next hit 'y' position to calculate the new cursor index. - mEventData->mPrimaryCursorPosition = Text::GetClosestCursorIndex( mModel->mVisualModel, - mModel->mLogicalModel, - mMetrics, - mEventData->mCursorHookPositionX, - hitPointY ); - } + // Use the cursor hook position 'x' and the next hit 'y' position to calculate the new cursor index. + mEventData->mPrimaryCursorPosition = Text::GetClosestCursorIndex( mModel->mVisualModel, + mModel->mLogicalModel, + mMetrics, + mEventData->mCursorHookPositionX, + hitPointY ); } else if( Dali::DALI_KEY_CURSOR_DOWN == keyCode ) {