diff --git a/scim-wnn/src/romkan.cpp b/scim-wnn/src/romkan.cpp index 6e3282f..d61cf4d 100644 --- a/scim-wnn/src/romkan.cpp +++ b/scim-wnn/src/romkan.cpp @@ -56,7 +56,7 @@ void Romkan::setPos(int p) { if (p < 0) p = 0; - if (p > getTextLength()) p = getTextLength(); + else if (p > getTextLength()) p = getTextLength(); pos = p; buf.clear(); } @@ -80,7 +80,7 @@ buf += k; String s; s = k; - text = text.substr(0,pos) + utf8_mbstowcs(s) + text.substr(pos ++); + text = text.substr(0,pos) + utf8_mbstowcs(s) + text.substr(pos ++); //return(text); return(eval()); } @@ -175,7 +175,7 @@ */ void Romkan::backspace() { - if (getPos() == 0); + if (getPos() == 0) return; text = text.substr(0,pos - 1) + text.substr(pos); setPos(pos - 1); // BS�Ͼ��Хåե���BS���륾�� @@ -252,8 +252,8 @@ */ bool Romkan::keyEventHook(const KeyEvent &key) { - if (text.empty()) return(false); - if (text.substr(pos - 1,1) == utf8_mbstowcs("Z")) { + if (!buf.length()) return(false); + if (buf[buf.length() - 1] == 'Z') { if (key.code == SCIM_KEY_space) { insert(key.get_ascii_code()); return(true); diff --git a/scim-wnn/src/scim_wnn_imengine.cpp b/scim-wnn/src/scim_wnn_imengine.cpp index b749408..f70203b 100644 --- a/scim-wnn/src/scim_wnn_imengine.cpp +++ b/scim-wnn/src/scim_wnn_imengine.cpp @@ -66,10 +66,6 @@ static ConfigPointer _scim_config; extern "C" { - // ����Ǥ��礦�� - // KDE�ʤ󤫤Ǥ�Ȥ��Ƥ�ưŪ���ǥ��󥰤ξ����� - // C��󥱡����Ǵؿ�̾���ꤵ���ơ����ä��饤�󥹥��󥹺��äġ����졣 - // ���ݤ���ͤ����ޤ��̤��ɤ����ɤ��� void scim_module_init (void) { } @@ -106,12 +102,10 @@ } WnnFactory::WnnFactory(const WideString & name, const String & languages) { - // ʸ�������¤��� if (name.length () <= 8) m_name = name; else m_name.assign (name.begin (), name.begin () + 8); - // �Ȥꤢ�������ܸ�Ķ��Ǹ��ꤷ�����ȥ����� if (languages == String ("default")) set_languages (String (_("ja_JP"))); else @@ -120,43 +114,36 @@ WideString WnnFactory::get_name () const { - // ̾�����֤��Τ͡�utf8_mbstowcs(_("Wnn"))�ǡ� return m_name; } WideString WnnFactory::get_authors () const { - // AUTHER�͡� return utf8_mbstowcs (String (_("(C) 2004 TAM(Teppei Tamra) "))); } WideString WnnFactory::get_credits () const { - // CREDIT�͡��Ȥꤢ�������ǡ� return WideString (); } WideString WnnFactory::get_help () const { - // HELP��񤫤ʤ��ȥ���ʤΤ͡� return utf8_mbstowcs (String (_("SCIM-WNN HELP"))); } String WnnFactory::get_uuid () const { - // uuidgená���Ƽ��̤ȡ���ˡ����ʤ�ʤ�Ǥ�褵�������ɤ⡣ return String ("c069395a-d62f-4a77-8229-446e44a99976"); } String WnnFactory::get_icon_file () const { - // �����������ꡣ���ʤ��Ȥ͡� return String (SCIM_WNN_ICON_FILE); } IMEngineInstancePointer WnnFactory::create_instance (const String& encoding, int id) { - // �ºݤ˥��󥹥��󥹤��롣 return new WnnInstance (this, encoding, id); } @@ -185,7 +172,6 @@ } -// �� �� ý �� // ��ʪ�� @@ -201,7 +187,6 @@ m_iconv.set_encoding ("EUC-JP"); // �ǥե���ȥ������ꡣ - // ����ե����뤫���ɤ�褦�ˤ��Ƥ��ˤ礴�ˤ硣 scim_string_to_key_list(k_conversion_start, _scim_config->read(String(SCIM_CONFIG_WNN_KEY_CONVERSION_START), String(SCIM_DEFAULT_WNN_KEY_CONVERSION_START))); @@ -312,6 +297,7 @@ return(false); } k_backward.comp(key) ? m_rk.setPos(m_rk.getPos() - 1) : m_rk.setPos(m_rk.getPos() + 1); + update_preedit_string(m_rk.getText()); update_preedit_caret(m_rk.getPos()); return(true); } else @@ -523,8 +509,8 @@ void WnnInstance::move_preedit_caret (unsigned int pos) { - if (!m_conversion) m_rk.setPos(pos); - update_preedit_caret(pos); + //if (!m_conversion) m_rk.setPos(pos); + //update_preedit_caret(pos); } void WnnInstance::select_candidate (unsigned int item)