(Text Controller) Remove meaningless check to see if an unsigned int is positive... 34/119134/2
authorAdeel Kazmi <adeel.kazmi@samsung.com>
Wed, 15 Mar 2017 16:11:42 +0000 (16:11 +0000)
committerAdeel Kazmi <adeel.kazmi@samsung.com>
Wed, 15 Mar 2017 16:13:05 +0000 (16:13 +0000)
Fixes an SVACE error.

Change-Id: I8118ffca01eb1921549ae2bc2e4366c1e03984b3

dali-toolkit/internal/text/text-controller-impl.cpp

index 986c4e5..da7d929 100644 (file)
@@ -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 );
 
     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 )
   {
   }
   else if(   Dali::DALI_KEY_CURSOR_DOWN == keyCode )
   {