aboutsummaryrefslogtreecommitdiffhomepage
path: root/qt/ScintillaEditBase/ScintillaEditBase.cpp
diff options
context:
space:
mode:
authormitchell <unknown>2019-07-11 12:49:28 -0400
committermitchell <unknown>2019-07-11 12:49:28 -0400
commite305512e58c726ef1855ffec4af69c90cfc9e396 (patch)
tree9ac416d8c4d4c676d9bf8b7c6f546e179b583616 /qt/ScintillaEditBase/ScintillaEditBase.cpp
parentf40378978a7b3bb901a2085a2c76b1ac4a3f45a0 (diff)
downloadscintilla-mirror-e305512e58c726ef1855ffec4af69c90cfc9e396.tar.gz
Backport: Feature [feature-requests:#1293]. InsertCharacter replaces AddCharUTF.
Backport of changeset 7575:e1e9f53b0423.
Diffstat (limited to 'qt/ScintillaEditBase/ScintillaEditBase.cpp')
-rw-r--r--qt/ScintillaEditBase/ScintillaEditBase.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/qt/ScintillaEditBase/ScintillaEditBase.cpp b/qt/ScintillaEditBase/ScintillaEditBase.cpp
index d7f25dbdc..ea65fb1d3 100644
--- a/qt/ScintillaEditBase/ScintillaEditBase.cpp
+++ b/qt/ScintillaEditBase/ScintillaEditBase.cpp
@@ -259,7 +259,7 @@ void ScintillaEditBase::keyPressEvent(QKeyEvent *event)
QString text = event->text();
if (input && !text.isEmpty() && text[0].isPrint()) {
QByteArray utext = sqt->BytesForDocument(text);
- sqt->AddCharUTF(utext.data(), utext.size());
+ sqt->InsertCharacter(utext.data(), utext.size());
} else {
event->ignore();
}
@@ -450,7 +450,7 @@ void ScintillaEditBase::DrawImeIndicator(int indicator, int len)
{
// Emulate the visual style of IME characters with indicators.
// Draw an indicator on the character before caret by the character bytes of len
- // so it should be called after AddCharUTF().
+ // so it should be called after InsertCharacter().
// It does not affect caret positions.
if (indicator < 8 || indicator > INDIC_MAX) {
return;
@@ -548,9 +548,8 @@ void ScintillaEditBase::inputMethodEvent(QInputMethodEvent *event)
const unsigned int ucWidth = commitStr.at(i).isHighSurrogate() ? 2 : 1;
const QString oneCharUTF16 = commitStr.mid(i, ucWidth);
const QByteArray oneChar = sqt->BytesForDocument(oneCharUTF16);
- const int oneCharLen = oneChar.length();
- sqt->AddCharUTF(oneChar.data(), oneCharLen);
+ sqt->InsertCharacter(oneChar.data(), oneChar.length());
i += ucWidth;
}
@@ -576,7 +575,7 @@ void ScintillaEditBase::inputMethodEvent(QInputMethodEvent *event)
const QByteArray oneChar = sqt->BytesForDocument(oneCharUTF16);
const int oneCharLen = oneChar.length();
- sqt->AddCharUTF(oneChar.data(), oneCharLen);
+ sqt->InsertCharacter(oneChar.data(), oneCharLen);
DrawImeIndicator(imeIndicator[i], oneCharLen);
i += ucWidth;