aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authornyamatongwe <devnull@localhost>2000-11-30 23:15:11 +0000
committernyamatongwe <devnull@localhost>2000-11-30 23:15:11 +0000
commitcc86398fce217d861c4a2477ed2827368766b9e7 (patch)
treed43b35ebfd556b6427c32d04f4aad3f715ed399a /src
parentf0e8c7c4c3a5390d0b8150c700cec5c1ad3b226d (diff)
downloadscintilla-mirror-cc86398fce217d861c4a2477ed2827368766b9e7.tar.gz
Patch from ActiveState for better clipboard handling.
Diffstat (limited to 'src')
-rw-r--r--src/Editor.cxx11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx
index 68d41a59c..6c7bda2b2 100644
--- a/src/Editor.cxx
+++ b/src/Editor.cxx
@@ -1582,11 +1582,16 @@ void Editor::ClearDocumentStyle() {
}
void Editor::Cut() {
- Copy();
- ClearSelection();
+ if (!pdoc->IsReadOnly()) {
+ Copy();
+ ClearSelection();
+ }
}
void Editor::PasteRectangular(int pos, const char *ptr, int len) {
+ if (pdoc->IsReadOnly()) {
+ return;
+ }
currentPos = pos;
int insertPos = currentPos;
int xInsert = XFromPosition(currentPos);
@@ -3478,7 +3483,7 @@ long Editor::WndProc(unsigned int iMessage, unsigned long wParam, long lParam) {
case EM_CANPASTE:
case SCI_CANPASTE:
- return 1;
+ return !pdoc->IsReadOnly();
case EM_CHARFROMPOS: {
if (lParam == 0)