diff options
author | johnsonj <unknown> | 2015-12-14 15:03:51 +1100 |
---|---|---|
committer | johnsonj <unknown> | 2015-12-14 15:03:51 +1100 |
commit | 0ccfd637db4974013aabb997451b71b16394a8b0 (patch) | |
tree | 12bd9cd0f8f7a4a40cace25d6ba307cb24c18123 | |
parent | 1597105fb3569664744fc3016da50499de4d9b34 (diff) | |
download | scintilla-mirror-0ccfd637db4974013aabb997451b71b16394a8b0.tar.gz |
Block IME when some selected text is protected.
-rw-r--r-- | doc/ScintillaHistory.html | 4 | ||||
-rw-r--r-- | gtk/ScintillaGTK.cxx | 2 | ||||
-rw-r--r-- | qt/ScintillaEditBase/ScintillaEditBase.cpp | 2 | ||||
-rw-r--r-- | win32/ScintillaWin.cxx | 2 |
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; } |