aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorjohnsonj <devnull@localhost>2015-12-14 15:03:51 +1100
committerjohnsonj <devnull@localhost>2015-12-14 15:03:51 +1100
commita2dd3d187967cd838747329dc37382796b01ad4f (patch)
treeb2acc097393603e33667266bb1b730ef1aa32528
parenteeb150883f74d5908872d71087814e73f4dd640e (diff)
downloadscintilla-mirror-a2dd3d187967cd838747329dc37382796b01ad4f.tar.gz
Block IME when some selected text is protected.
-rw-r--r--doc/ScintillaHistory.html4
-rw-r--r--gtk/ScintillaGTK.cxx2
-rw-r--r--qt/ScintillaEditBase/ScintillaEditBase.cpp2
-rw-r--r--win32/ScintillaWin.cxx2
4 files changed, 7 insertions, 3 deletions
diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html
index 57680f59a..29e664b12 100644
--- a/doc/ScintillaHistory.html
+++ b/doc/ScintillaHistory.html
@@ -541,6 +541,10 @@
On GTK+ and Qt, Korean input by word fixed.
</li>
<li>
+ On GTK+, Qt, and Win32 block IME input when document is read-only or any selected text
+ is protected.
+ </li>
+ <li>
On GTK+ on OS X, fix warning during destruction.
<a href="http://sourceforge.net/p/scintilla/bugs/1777/">Bug #1777</a>.
</li>
diff --git a/gtk/ScintillaGTK.cxx b/gtk/ScintillaGTK.cxx
index 19576ce9e..eaf2e26f8 100644
--- a/gtk/ScintillaGTK.cxx
+++ b/gtk/ScintillaGTK.cxx
@@ -2434,7 +2434,7 @@ void ScintillaGTK::PreeditChangedInlineThis() {
// Copy & paste by johnsonj with a lot of helps of Neil
// Great thanks for my foreruners, jiniya and BLUEnLIVE
try {
- if (pdoc->IsReadOnly()) {
+ if (pdoc->IsReadOnly() || SelectionContainsProtected()) {
gtk_im_context_reset(im_context);
return;
}
diff --git a/qt/ScintillaEditBase/ScintillaEditBase.cpp b/qt/ScintillaEditBase/ScintillaEditBase.cpp
index ea516fe17..13401fedf 100644
--- a/qt/ScintillaEditBase/ScintillaEditBase.cpp
+++ b/qt/ScintillaEditBase/ScintillaEditBase.cpp
@@ -443,7 +443,7 @@ void ScintillaEditBase::inputMethodEvent(QInputMethodEvent *event)
// Copy & paste by johnsonj with a lot of helps of Neil
// Great thanks for my forerunners, jiniya and BLUEnLIVE
- if (sqt->pdoc->IsReadOnly()) {
+ if (sqt->pdoc->IsReadOnly() || sqt->SelectionContainsProtected()) {
// Here, a canceling and/or completing composition function is needed.
return;
}
diff --git a/win32/ScintillaWin.cxx b/win32/ScintillaWin.cxx
index b97a39ff3..f536482a1 100644
--- a/win32/ScintillaWin.cxx
+++ b/win32/ScintillaWin.cxx
@@ -1007,7 +1007,7 @@ sptr_t ScintillaWin::HandleCompositionInline(uptr_t, sptr_t lParam) {
IMContext imc(MainHWND());
if (!imc.hIMC)
return 0;
- if (pdoc->IsReadOnly()) {
+ if (pdoc->IsReadOnly() || SelectionContainsProtected()) {
::ImmNotifyIME(imc.hIMC, NI_COMPOSITIONSTR, CPS_CANCEL, 0);
return 0;
}