return 0.0f;
}
-void Controller::UpdateAfterFontChange( std::string& newDefaultFont )
+void Controller::UpdateAfterFontChange( const std::string& newDefaultFont )
{
DALI_LOG_INFO( gLogFilter, Debug::Concise, "Controller::UpdateAfterFontChange");
return mImpl->mTextColor;
}
-bool Controller::RemoveText( int cursorOffset, int numberOfChars )
+bool Controller::RemoveText( int cursorOffset, int numberOfCharacters )
{
bool removed = false;
return removed;
}
- DALI_LOG_INFO( gLogFilter, Debug::General, "Controller::RemoveText %p mText.Count() %d cursor %d cursorOffset %d numberOfChars %d\n",
- this, mImpl->mLogicalModel->mText.Count(), mImpl->mEventData->mPrimaryCursorPosition, cursorOffset, numberOfChars );
+ DALI_LOG_INFO( gLogFilter, Debug::General, "Controller::RemoveText %p mText.Count() %d cursor %d cursorOffset %d numberOfCharacters %d\n",
+ this, mImpl->mLogicalModel->mText.Count(), mImpl->mEventData->mPrimaryCursorPosition, cursorOffset, numberOfCharacters );
if( !mImpl->IsShowingPlaceholderText() )
{
cursorIndex = oldCursorIndex + cursorOffset;
}
- if( ( cursorIndex + numberOfChars ) > currentText.Count() )
+ if( ( cursorIndex + numberOfCharacters ) > currentText.Count() )
{
- numberOfChars = currentText.Count() - cursorIndex;
+ numberOfCharacters = currentText.Count() - cursorIndex;
}
- if( ( cursorIndex + numberOfChars ) <= currentText.Count() )
+ if( ( cursorIndex + numberOfCharacters ) <= currentText.Count() )
{
// Update the input style and remove the text's style before removing the text.
mImpl->mLogicalModel->RetrieveStyle( cursorIndex, mImpl->mEventData->mInputStyle );
// Remove the text's style before removing the text.
- mImpl->mLogicalModel->UpdateTextStyleRuns( cursorIndex, -numberOfChars );
+ mImpl->mLogicalModel->UpdateTextStyleRuns( cursorIndex, -numberOfCharacters );
// Remove the characters.
Vector<Character>::Iterator first = currentText.Begin() + cursorIndex;
- Vector<Character>::Iterator last = first + numberOfChars;
+ Vector<Character>::Iterator last = first + numberOfCharacters;
currentText.Erase( first, last );
// Cursor position retreat
oldCursorIndex = cursorIndex;
- DALI_LOG_INFO( gLogFilter, Debug::General, "Controller::RemoveText %p removed %d\n", this, numberOfChars );
+ DALI_LOG_INFO( gLogFilter, Debug::General, "Controller::RemoveText %p removed %d\n", this, numberOfCharacters );
removed = true;
}
}
// Remove the previous IMF pre-edit (predicitive text)
if( mImpl->mEventData->mPreEditFlag &&
- ( 0 != mImpl->mEventData->mPreEditLength ) )
+ ( 0u != mImpl->mEventData->mPreEditLength ) )
{
- CharacterIndex offset = mImpl->mEventData->mPrimaryCursorPosition - mImpl->mEventData->mPreEditStartPosition;
+ const CharacterIndex offset = mImpl->mEventData->mPrimaryCursorPosition - mImpl->mEventData->mPreEditStartPosition;
- removedPrevious = RemoveText( -static_cast<int>(offset), mImpl->mEventData->mPreEditLength );
+ removedPrevious = RemoveText( -static_cast<int>( offset ), mImpl->mEventData->mPreEditLength );
mImpl->mEventData->mPrimaryCursorPosition = mImpl->mEventData->mPreEditStartPosition;
- mImpl->mEventData->mPreEditLength = 0;
+ mImpl->mEventData->mPreEditLength = 0u;
}
else
{
const Length numberOfCharactersInModel = mImpl->mLogicalModel->mText.Count();
- // Restrict new text to fit within Maximum characters setting
+ // Restrict new text to fit within Maximum characters setting.
Length maxSizeOfNewText = std::min( ( mImpl->mMaximumNumberOfCharacters - numberOfCharactersInModel ), characterCount );
maxLengthReached = ( characterCount > maxSizeOfNewText );
// Transform a text array encoded in utf8 into an array encoded in utf32.
// It returns the actual number of characters.
- Length characterCount = Utf8ToUtf32( utf8, size, utf32Characters.Begin() );
+ const Length characterCount = Utf8ToUtf32( utf8, size, utf32Characters.Begin() );
utf32Characters.Resize( characterCount );
// Reset the cursor position
* @brief Remove a given number of characters
*
* @param[in] cursorOffset Start position from the current cursor position to start deleting characters.
- * @param[in] numberOfChars The number of characters to delete from the cursorOffset.
+ * @param[in] numberOfCharacters The number of characters to delete from the cursorOffset.
* @return True if the remove was successful.
*/
- bool RemoveText( int cursorOffset, int numberOfChars );
+ bool RemoveText( int cursorOffset, int numberOfCharacters );
/**
* @brief Retrieve the current cursor position.
* @ brief Update the text after a font change
* @param[in] newDefaultFont The new font to change to
*/
- void UpdateAfterFontChange( std::string& newDefaultFont );
+ void UpdateAfterFontChange( const std::string& newDefaultFont );
/**
* @brief Set the text color