[Tizen] Fix Set and Get InputPanelUserData()
[platform/core/uifw/dali-adaptor.git] / adaptors / ecore / wayland / imf-manager-impl-ecore-wl.cpp
index 5764c3a..0f23a74 100644 (file)
@@ -763,7 +763,7 @@ void ImfManager::SetInputPanelUserData( const std::string& data )
   if( mIMFContext )
   {
     int length = data.length();
-    ecore_imf_context_input_panel_imdata_set( mIMFContext, &data, length );
+    ecore_imf_context_input_panel_imdata_set( mIMFContext, data.c_str(), length );
   }
 }
 
@@ -773,8 +773,14 @@ void ImfManager::GetInputPanelUserData( std::string& data )
 
   if( mIMFContext )
   {
-    int* length = NULL;
-    ecore_imf_context_input_panel_imdata_get( mIMFContext, &data, length );
+    int length = 256;
+    char* buffer = reinterpret_cast< char* >( calloc ( 1, length * sizeof ( char ) ) );
+    if( buffer != NULL )
+    {
+      ecore_imf_context_input_panel_imdata_get( mIMFContext, buffer, &length );
+      data = buffer;
+      free( buffer );
+    }
   }
 }