X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Ftext%2Ftext-controller.cpp;h=ef10a3f5fab98943c7bb606213af94d5d41fc2ea;hb=fcbd0fc67ae67b5f068f09483a765d4afa7bd52b;hp=6bcb90c43dfa54949c4b17236d77506669e74fc6;hpb=3480a42d70353c1975e53f07a492cf12cdd76578;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/text/text-controller.cpp b/dali-toolkit/internal/text/text-controller.cpp index 6bcb90c..ef10a3f 100644 --- a/dali-toolkit/internal/text/text-controller.cpp +++ b/dali-toolkit/internal/text/text-controller.cpp @@ -77,6 +77,9 @@ void Controller::SetText( const std::string& text ) { DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Controller::SetText\n" ); + // Reset keyboard as text changed + mImpl->ResetImfManager(); + // Remove the previously set text ResetText(); @@ -142,8 +145,8 @@ void Controller::SetText( const std::string& text ) 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(); @@ -1923,17 +1926,20 @@ bool Controller::BackspaceKeyEvent() 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(); + } } }