diff --git a/honoka/src/romkan.cpp b/honoka/src/romkan.cpp index 5af95a1..3ef3b18 100644 --- a/honoka/src/romkan.cpp +++ b/honoka/src/romkan.cpp @@ -197,6 +197,7 @@ else if (p > getTextLength()) p = getTextLength(); pos = p; buf.clear(); + rmChars.clear(); } @@ -207,6 +208,7 @@ { text.clear(); buf.clear(); + rmChars.clear(); } @@ -221,6 +223,7 @@ switch(mode) { case ASCII: { buf.clear(); + rmChars.clear(); text = text.substr(0,pos) + utf8_mbstowcs(s) + text.substr(pos); pos ++; return text; @@ -228,6 +231,7 @@ } case WASCII: { buf.clear(); + rmChars.clear(); WideString w = utf8_mbstowcs(s); convHanZen(w,pos); text = text.substr(0,pos) + w + text.substr(pos); @@ -286,6 +290,7 @@ else if (mode == KROMA) convHiraKata(r); text = text.substr(0,pos - 2) + r + text.substr(pos - 1); buf = buf.substr(buf.length() - 1,1); + rmChars.clear(); } } @@ -297,6 +302,7 @@ else if (mode == KROMA) convHiraKata(r); text = text.substr(0,pos - 2) + r + text.substr(pos - 1); buf = buf.substr(buf.length() - 1,1); + rmChars.clear(); return text; } } @@ -313,6 +319,7 @@ text = text.substr(0,pos - buf.length()) + r + text.substr(pos); pos = pos - buf.length() + r.length(); buf.clear(); + rmChars.clear(); return text; } if (buf.length()) { @@ -320,6 +327,7 @@ text = text.substr(0,pos - buf.length()) + text.substr(pos - buf.length() + 1); pos --; } + rmChars = rmChars + buf.substr(0,1); buf = buf.substr(1); return eval(); } @@ -347,6 +355,7 @@ { text = t; buf.clear(); + rmChars.clear(); } @@ -394,13 +403,16 @@ if (buf.length()) buf = buf.substr(0,buf.length() - 1); // BS���˥Хåե���Ƭ��ʸ���������� // ���ΰ�ʸ�������󥰥�Х��ȤǤʤ��ä������˴��� - if (pos && (!removeRemainder)) { + if (pos && (!removeRemainder) && rmChars.size()) { + /* while((pos - buf.size()) > 0) { String s = utf8_wcstombs(text.substr(pos - (buf.length() + 1),1)); if (s.length() == 1) { buf = s + buf; } else break; - } + }*/ + buf = rmChars + buf; + rmChars.clear(); eval(); return; @@ -444,6 +456,7 @@ { setPos(convZenHan(text,getPos())); buf.clear(); + rmChars.clear(); } /*! @@ -453,6 +466,7 @@ { setPos(convHanZen(text,getPos())); buf.clear(); + rmChars.clear(); } diff --git a/honoka/src/romkan.h b/honoka/src/romkan.h index c78b46d..535b131 100644 --- a/honoka/src/romkan.h +++ b/honoka/src/romkan.h @@ -81,6 +81,7 @@ protected: String buf; + String rmChars; String modeName; enum inputMode {ROMA,HROMA,KROMA,ASCII,WASCII}; inputMode mode;