]> git.pld-linux.org Git - packages/scim-tables.git/blob - scim-tables-rhbz232860.patch
- updated to 0.5.14.1
[packages/scim-tables.git] / scim-tables-rhbz232860.patch
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
5  
6      WideString              m_last_committed;
7  
8 +    bool                    m_last_auto_select;
9 +    uint32                  m_last_auto_select_offset;
10 +    WideString                  m_last_auto_select_string;
11 +
12  public:
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)
19  bool
20  TableInstance::delete_phrase ()
21  {
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];
26  
27 @@ -1461,6 +1461,26 @@ TableInstance::delete_phrase ()
28              refresh_lookup_table ();
29          }
30          return true;
31 +    } else if (m_last_auto_select == true) {
32 +        if (m_factory->m_table.delete_phrase (m_last_auto_select_offset)) {
33 +            AttributeList attributes;
34 +            WideString prompt;
35 +            
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)));
38 +
39 +            m_last_auto_select = false;
40 +            m_last_auto_select_offset = 0;
41 +            m_last_auto_select_string = WideString();
42 +
43 +            if (prompt.length ()) {
44 +                update_aux_string (prompt, attributes);
45 +                show_aux_string ();
46 +            } else {
47 +                hide_aux_string ();
48 +            }
49 +        }
50 +        return true;
51      }
52      return false;
53  }
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);
57  
58 +    m_last_auto_select = true;
59 +    m_last_auto_select_offset = offset;
60 +    m_last_auto_select_string = str;
61 +
62      m_converted_strings.push_back (str);
63      m_converted_indexes.push_back (offset);
64  
This page took 0.126404 seconds and 3 git commands to generate.