(toolkit) fix klocwork issues 46/30346/2
authorXiangyin Ma <x1.ma@samsung.com>
Fri, 14 Nov 2014 17:07:33 +0000 (17:07 +0000)
committerXiangyin Ma <x1.ma@samsung.com>
Fri, 14 Nov 2014 17:45:22 +0000 (17:45 +0000)
Change-Id: I37803bebef48a9bf836b77eec6e2984296afc8f0

base/dali-toolkit/internal/controls/text-input/text-input-decorator-impl.cpp
base/dali-toolkit/internal/controls/text-input/text-input-text-highlight-impl.cpp
base/dali-toolkit/internal/focus-manager/keyboard-focus-manager-impl.cpp

index 6ac183f..9f83898 100644 (file)
@@ -93,6 +93,7 @@ Decorator::Decorator( TextViewCharacterPositioning& textViewManager, TextInputTe
   mCursorRTLEnabled( false ),
   mIsGrabHandleInScrollArea( false ),
   mIsCursorInScrollArea( false ),
+  mGrabHandleVisibility( false ),
   mGrabHandleEnabled( true )
 {
 }
index 469c0aa..7475678 100644 (file)
@@ -208,12 +208,15 @@ TextHighlight::HighlightInfo TextHighlight::CalculateHighlightInfo( std::size_t
         {
           lastIt = std::max( textLayoutInfo.mCharacterLayoutInfoTable.begin(), lastIt - 1 );
         }
-        const Size rowSize( mTextViewCharacterPositioning.GetRowRectFromCharacterPosition( lastIt - textLayoutInfo.mCharacterLayoutInfoTable.begin(), min, max ) );
-        maxRowLeft = std::min(maxRowLeft, min.x);
-        maxRowRight = std::max(maxRowRight, max.x);
-        float rowBottom = lastIt->mPosition.y - textLayoutInfo.mScrollOffset.y;
-        float rowTop = rowBottom - rowSize.height;
-        newHighlightInfo.AddQuad( rowLeft, rowTop, rowRight, rowBottom );
+        if( lastIt != end )
+        {
+          const Size rowSize( mTextViewCharacterPositioning.GetRowRectFromCharacterPosition( lastIt - textLayoutInfo.mCharacterLayoutInfoTable.begin(), min, max ) );
+          maxRowLeft = std::min(maxRowLeft, min.x);
+          maxRowRight = std::max(maxRowRight, max.x);
+          float rowBottom = lastIt->mPosition.y - textLayoutInfo.mScrollOffset.y;
+          float rowTop = rowBottom - rowSize.height;
+          newHighlightInfo.AddQuad( rowLeft, rowTop, rowRight, rowBottom );
+        }
       }
     }
 
index dffe9d5..0ccc095 100644 (file)
@@ -559,8 +559,6 @@ void KeyboardFocusManager::OnKeyEvent(const KeyEvent& event)
           // Move the focus towards right
           MoveFocus(Toolkit::Control::Right);
         }
-
-        isFocusStartableKey = true;
       }
       else
       {