Send the empty string to IME when PlaceholderText shows 93/163293/2
authorSeoyeon Kim <seoyeon2.kim@samsung.com>
Fri, 8 Dec 2017 07:29:45 +0000 (16:29 +0900)
committerSeoyeon Kim <seoyeon2.kim@samsung.com>
Fri, 8 Dec 2017 08:53:49 +0000 (17:53 +0900)
- 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 <seoyeon2.kim@samsung.com>
automated-tests/src/dali-toolkit-internal/utc-Dali-Text-Controller.cpp
dali-toolkit/internal/text/text-controller.cpp

index 8d73622..02f2e66 100644 (file)
@@ -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 );
index 1c15e22..27b982f 100755 (executable)
@@ -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 );