Fix delete/get_surrounding_text call sequence problem
authorLi Zhang <li2012.zhang@samsung.com>
Mon, 11 Mar 2013 09:30:37 +0000 (17:30 +0800)
committerJihoon Kim <jihoon48.kim@samsung.com>
Tue, 12 Mar 2013 05:05:57 +0000 (14:05 +0900)
Change-Id: I65e6cd9fbdbaf3272cf186ac1b1cc4a3f1fff6d4

configure.ac
ism/modules/frontend/scim_socket_frontend.cpp
ism/modules/imengine/scim_socket_imengine.cpp
ism/src/scim_trans_commands.h
packaging/isf.spec
releasenote.txt

index ac171d3..3ea4f10 100755 (executable)
@@ -1,6 +1,6 @@
 # Process this file with autoconf to produce a configure script
 #AC_INIT(scim, 1.4.7, suzhe@tsinghua.org.cn)
-AC_INIT(isf, 2.4.6309, isf@samsung.com)
+AC_INIT(isf, 2.4.6311, isf@samsung.com)
 AC_CONFIG_SRCDIR([ism/src/scim.h])
 m4_pattern_allow([^AS_])
 
@@ -11,7 +11,7 @@ m4_pattern_allow([^AS_])
 # ISF version
 ISF_MAJOR_VERSION=2
 ISF_MINOR_VERSION=4
-ISF_MICRO_VERSION=6309
+ISF_MICRO_VERSION=6311
 
 ISF_VERSION=$ISF_MAJOR_VERSION.$ISF_MINOR_VERSION.$ISF_MICRO_VERSION
 
index 582f540..7ca7ef5 100644 (file)
@@ -510,12 +510,20 @@ SocketFrontEnd::send_helper_event (int id, const String &helper_uuid, const Tran
 bool
 SocketFrontEnd::get_surrounding_text (int id, WideString &text, int &cursor, int maxlen_before, int maxlen_after)
 {
+    bool ret = false;
     text.clear ();
     cursor = 0;
 
     if (m_current_instance == id && m_current_socket_client >= 0 && (maxlen_before != 0 || maxlen_after != 0)) {
+        bool cont = false;
         if (maxlen_before < 0) maxlen_before = -1;
         if (maxlen_after < 0) maxlen_after = -1;
+        Socket socket_client (m_current_socket_client);
+        if ( m_send_trans.get_data_type () != SCIM_TRANS_DATA_UNKNOWN) {
+            m_send_trans.put_command (ISM_TRANS_CMD_TRANSACTION_CONTINUE);
+            m_send_trans.write_to_socket (socket_client);
+            cont = true;
+        }
 
         m_temp_trans.clear ();
         m_temp_trans.put_command (SCIM_TRANS_CMD_REPLY);
@@ -523,8 +531,6 @@ SocketFrontEnd::get_surrounding_text (int id, WideString &text, int &cursor, int
         m_temp_trans.put_data ((uint32) maxlen_before);
         m_temp_trans.put_data ((uint32) maxlen_after);
 
-        Socket socket_client (m_current_socket_client);
-
         if (m_temp_trans.write_to_socket (socket_client) &&
             m_temp_trans.read_from_socket (socket_client, m_socket_timeout)) {
 
@@ -537,25 +543,41 @@ SocketFrontEnd::get_surrounding_text (int id, WideString &text, int &cursor, int
                 m_temp_trans.get_command (cmd) && cmd == SCIM_TRANS_CMD_GET_SURROUNDING_TEXT &&
                 m_temp_trans.get_data (text) && m_temp_trans.get_data (cur)) {
                 cursor = (int) cur;
-                return true;
+                ret = true;
             }
         }
+        if (cont) {
+            int cmd;
+            m_send_trans.clear ();
+            m_send_trans.put_command (SCIM_TRANS_CMD_REPLY);
+
+            // Move the read ptr to the end.
+            m_send_trans.get_command (cmd);
+        }
     }
-    return false;
+    return ret;
+
 }
 
 bool
 SocketFrontEnd::delete_surrounding_text (int id, int offset, int len)
 {
+    bool ret = false;
     if (m_current_instance == id && m_current_socket_client >= 0 && len > 0) {
+        bool cont = false;
+
+        Socket socket_client (m_current_socket_client);
+        if (m_send_trans.get_data_type () != SCIM_TRANS_DATA_UNKNOWN) {
+            m_send_trans.put_command (ISM_TRANS_CMD_TRANSACTION_CONTINUE);
+            m_send_trans.write_to_socket (socket_client);
+            cont = true;
+        }
         m_temp_trans.clear ();
         m_temp_trans.put_command (SCIM_TRANS_CMD_REPLY);
         m_temp_trans.put_command (SCIM_TRANS_CMD_DELETE_SURROUNDING_TEXT);
         m_temp_trans.put_data ((uint32) offset);
         m_temp_trans.put_data ((uint32) len);
 
-        Socket socket_client (m_current_socket_client);
-
         if (m_temp_trans.write_to_socket (socket_client) &&
             m_temp_trans.read_from_socket (socket_client, m_socket_timeout)) {
 
@@ -566,10 +588,18 @@ SocketFrontEnd::delete_surrounding_text (int id, int offset, int len)
                 m_temp_trans.get_data (key) && key == m_current_socket_client_key &&
                 m_temp_trans.get_command (cmd) && cmd == SCIM_TRANS_CMD_DELETE_SURROUNDING_TEXT &&
                 m_temp_trans.get_command (cmd) && cmd == SCIM_TRANS_CMD_OK)
-                return true;
+                ret = true;
+        }
+        if (cont) {
+            int cmd;
+            m_send_trans.clear ();
+            m_send_trans.put_command (SCIM_TRANS_CMD_REPLY);
+
+            // Move the read ptr to the end.
+            m_send_trans.get_command (cmd);
         }
     }
-    return false;
+    return ret;
 }
 
 void
index 7a90411..0d35fc1 100644 (file)
@@ -1225,6 +1225,10 @@ SocketInstance::do_transaction (Transaction &trans, bool &ret)
                         set_candidate_style ((ISF_CANDIDATE_PORTRAIT_LINE_T)portrait_line, (ISF_CANDIDATE_MODE_T)mode);
                     break;
                 }
+                case ISM_TRANS_CMD_TRANSACTION_CONTINUE:
+                {
+                    cont = true;
+                }
                 default:
                     SCIM_DEBUG_IMENGINE(3) << "  Strange cmd: " << cmd << "\n";
             }
index e5dd4fb..b224acc 100644 (file)
@@ -528,6 +528,7 @@ const int SCIM_TRANS_CMD_DELETE_SURROUNDING_TEXT          = 169;
 const int ISM_TRANS_CMD_SHOW_ASSOCIATE_TABLE              = 170;
 const int ISM_TRANS_CMD_HIDE_ASSOCIATE_TABLE              = 171;
 const int ISM_TRANS_CMD_UPDATE_ASSOCIATE_TABLE            = 172;
+const int ISM_TRANS_CMD_TRANSACTION_CONTINUE              = 173;
 
 // Socket IMEngine to Socket FrontEnd
 const int SCIM_TRANS_CMD_NEW_INSTANCE                     = 200;
index ab59b14..31b9f98 100755 (executable)
@@ -3,8 +3,8 @@
 
 Name:       isf
 Summary:    Input Service Framework
-Version:    2.4.6309
-Release:    2
+Version:    2.4.6311
+Release:    1
 Group:      System Environment/Libraries
 License:    LGPL
 Source0:    %{name}-%{version}.tar.gz
index 0149ba5..646b36a 100644 (file)
@@ -1,3 +1,7 @@
+ISF 2.4.6311 :
+ 1. fix delete/get_surrounding_text call sequence problem
+
+
 ISF 2.4.6309 :
  1. [isf-panel-efl] remove ui_create_candidate_window() in slot_set_keyboard_ise
  2. [panel] fix bug panel hasn't handled onnection during booting