* Reset and notify the imf manager.
* Do not call the IMF manager if the text control is not editable.
Change-Id: If635978cef8503c1f2a42ee49ab75821f4d34915
Signed-off-by: Victor Cebollada <v.cebollada@samsung.com>
- // Reset incase we are in a pre-edit state.
- ImfManager imfManager = ImfManager::Get();
- if ( imfManager )
- imfManager.Reset(); // Will trigger a commit message
+ // Reset incase we are in a pre-edit state.
+ ImfManager imfManager = ImfManager::Get();
+ if ( imfManager )
+ {
+ imfManager.Reset(); // Will trigger a commit message
+ }
+
+ ClearPreEditFlag();
}
bool IsClipboardEmpty()
}
bool IsClipboardEmpty()
{
DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Controller::SetText\n" );
{
DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Controller::SetText\n" );
+ // Reset keyboard as text changed
+ mImpl->ResetImfManager();
+
// Remove the previously set text
ResetText();
// Remove the previously set text
ResetText();
mImpl->mEventData->mEventQueue.clear();
}
mImpl->mEventData->mEventQueue.clear();
}
- // Reset keyboard as text changed
- mImpl->ResetImfManager();
+ // Notify IMF as text changed
+ NotifyImfManager();
// Do this last since it provides callbacks into application code
mImpl->mControlInterface.TextChanged();
// Do this last since it provides callbacks into application code
mImpl->mControlInterface.TextChanged();
void Controller::NotifyImfManager()
{
void Controller::NotifyImfManager()
{
- ImfManager imfManager = ImfManager::Get();
-
- if( imfManager )
+ if( mImpl->mEventData )
- // Notifying IMF of a cursor change triggers a surrounding text request so updating it now.
- std::string text;
- GetText( text );
- imfManager.SetSurroundingText( text );
+ ImfManager imfManager = ImfManager::Get();
+
+ if( imfManager )
+ {
+ // Notifying IMF of a cursor change triggers a surrounding text request so updating it now.
+ std::string text;
+ GetText( text );
+ imfManager.SetSurroundingText( text );
- imfManager.SetCursorPosition( GetLogicalCursorPosition() );
- imfManager.NotifyCursorPosition();
+ imfManager.SetCursorPosition( GetLogicalCursorPosition() );
+ imfManager.NotifyCursorPosition();
+ }