1 diff -up scim-tables-0.5.7/src/scim_table_imengine.h.4-bz232860 scim-tables-0.5.7/src/scim_table_imengine.h
2 --- scim-tables-0.5.7/src/scim_table_imengine.h.4-bz232860 2005-10-26 17:53:53.000000000 +1000
3 +++ scim-tables-0.5.7/src/scim_table_imengine.h 2008-03-14 23:59:47.000000000 +1000
4 @@ -140,6 +140,10 @@ class TableInstance : public IMEngineIns
6 WideString m_last_committed;
8 + bool m_last_auto_select;
9 + uint32 m_last_auto_select_offset;
10 + WideString m_last_auto_select_string;
13 TableInstance (TableFactory *factory,
14 const String& encoding,
15 diff -up scim-tables-0.5.7/src/scim_table_imengine.cpp.4-bz232860 scim-tables-0.5.7/src/scim_table_imengine.cpp
16 --- scim-tables-0.5.7/src/scim_table_imengine.cpp.4-bz232860 2008-03-14 23:59:47.000000000 +1000
17 +++ scim-tables-0.5.7/src/scim_table_imengine.cpp 2008-03-15 00:05:09.000000000 +1000
18 @@ -1452,7 +1452,7 @@ TableInstance::post_process (char key)
20 TableInstance::delete_phrase ()
22 - if (m_lookup_table.number_of_candidates ()) {
23 + if (m_lookup_table.number_of_candidates () && m_last_auto_select == false) {
24 int pos = m_lookup_table.get_cursor_pos ();
25 uint32 offset = m_lookup_table_indexes [pos];
27 @@ -1461,6 +1461,26 @@ TableInstance::delete_phrase ()
28 refresh_lookup_table ();
31 + } else if (m_last_auto_select == true) {
32 + if (m_factory->m_table.delete_phrase (m_last_auto_select_offset)) {
33 + AttributeList attributes;
36 + prompt = utf8_mbstowcs (_("Custom phrase removed: ")) + m_last_auto_select_string;
37 + attributes.push_back (Attribute (0, prompt.length (), SCIM_ATTR_FOREGROUND, SCIM_RGB_COLOR(255, 32, 32)));
39 + m_last_auto_select = false;
40 + m_last_auto_select_offset = 0;
41 + m_last_auto_select_string = WideString();
43 + if (prompt.length ()) {
44 + update_aux_string (prompt, attributes);
54 @@ -1474,6 +1494,10 @@ TableInstance::lookup_to_converted (int
55 uint32 offset = m_lookup_table_indexes [index];
56 WideString str = m_factory->m_table.get_phrase (offset);
58 + m_last_auto_select = true;
59 + m_last_auto_select_offset = offset;
60 + m_last_auto_select_string = str;
62 m_converted_strings.push_back (str);
63 m_converted_indexes.push_back (offset);