From a9c2fdd131a2f08af2f04565c376d6e0e158d5b1 Mon Sep 17 00:00:00 2001 From: Seoyeon Kim Date: Fri, 8 Dec 2017 16:29:45 +0900 Subject: [PATCH] Send the empty string to IME when PlaceholderText shows - Fixed to send the empty string to IME when PlaceholderText shows. When DALi receives Retrieve surrounding event, should send IME only Normal Text, not Placeholder Text. Change-Id: I9b5cb18fc2c7bc8e57854c4acaaae6a9413cc5da Signed-off-by: Seoyeon Kim --- .../src/dali-toolkit-internal/utc-Dali-Text-Controller.cpp | 7 +++++++ dali-toolkit/internal/text/text-controller.cpp | 12 +++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/automated-tests/src/dali-toolkit-internal/utc-Dali-Text-Controller.cpp b/automated-tests/src/dali-toolkit-internal/utc-Dali-Text-Controller.cpp index 8d73622..02f2e66 100644 --- a/automated-tests/src/dali-toolkit-internal/utc-Dali-Text-Controller.cpp +++ b/automated-tests/src/dali-toolkit-internal/utc-Dali-Text-Controller.cpp @@ -184,9 +184,16 @@ int UtcDaliTextControllerImfEvent(void) // Enables the text input. controller->EnableTextInput( decorator ); + // Set the placeholder text. + controller->SetPlaceholderText( Controller::PLACEHOLDER_TYPE_INACTIVE, "Hello Dali" ); + // Creates an ImfManager. ImfManager imfManager = ImfManager::Get(); + // For coverage. + imfEvent = ImfManager::ImfEventData( ImfManager::GETSURROUNDING, "", 0, 0 ); + controller->OnImfEvent( imfManager, imfEvent ); + // Send VOID event. imfEvent = ImfManager::ImfEventData( ImfManager::VOID, "", 0, 0 ); controller->OnImfEvent( imfManager, imfEvent ); diff --git a/dali-toolkit/internal/text/text-controller.cpp b/dali-toolkit/internal/text/text-controller.cpp index 1c15e22..27b982f 100755 --- a/dali-toolkit/internal/text/text-controller.cpp +++ b/dali-toolkit/internal/text/text-controller.cpp @@ -2737,7 +2737,17 @@ ImfManager::ImfCallbackData Controller::OnImfEvent( ImfManager& imfManager, cons if( retrieveText ) { - mImpl->GetText( numberOfWhiteSpaces, text ); + if( !mImpl->IsShowingPlaceholderText() ) + { + // Retrieves the normal text string. + mImpl->GetText( numberOfWhiteSpaces, text ); + } + else + { + // When the current text is Placeholder Text, the surrounding text should be empty string. + // It means DALi should send empty string ("") to IME. + text = ""; + } } ImfManager::ImfCallbackData callbackData( ( retrieveText || retrieveCursor ), cursorPosition, text, false ); -- 2.7.4