(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 6ac183fafd37d33139bbecccc56255955de6897a..9f83898d7b07c1497730f52f38ff179ffc55468e 100644 (file)
@@ -93,6 +93,7 @@ Decorator::Decorator( TextViewCharacterPositioning& textViewManager, TextInputTe
   mCursorRTLEnabled( false ),
   mIsGrabHandleInScrollArea( false ),
   mIsCursorInScrollArea( false ),
+  mGrabHandleVisibility( false ),
   mGrabHandleEnabled( true )
 {
 }
index 469c0aab44d766af5f3a511240f912c91fd8ad7c..7475678f0e34e12769839c9840727ad083ec2eae 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 dffe9d5ed1b94173c85ac177cf35e1c1827ca61c..0ccc0954e81914be666da18812550c5970006bb4 100644 (file)
@@ -559,8 +559,6 @@ void KeyboardFocusManager::OnKeyEvent(const KeyEvent& event)
           // Move the focus towards right
           MoveFocus(Toolkit::Control::Right);
         }
-
-        isFocusStartableKey = true;
       }
       else
       {