diff options
author | nyamatongwe <devnull@localhost> | 2000-04-03 14:20:25 +0000 |
---|---|---|
committer | nyamatongwe <devnull@localhost> | 2000-04-03 14:20:25 +0000 |
commit | 943cf3a48da52953c1f2377d9e412ae81b79b5e0 (patch) | |
tree | 3b734fbcf4ecdc76f6f49dea3d89f9b72cf2f841 | |
parent | 0d64f2cfa2f14d8f7fe0694616bb7ff9ceff9a09 (diff) | |
download | scintilla-mirror-943cf3a48da52953c1f2377d9e412ae81b79b5e0.tar.gz |
Added Mark's change to support changing the document from within the
read-only notification.
-rw-r--r-- | src/Document.cxx | 15 | ||||
-rw-r--r-- | src/Document.h | 1 |
2 files changed, 12 insertions, 4 deletions
diff --git a/src/Document.cxx b/src/Document.cxx index 95107eb08..fb2650425 100644 --- a/src/Document.cxx +++ b/src/Document.cxx @@ -32,6 +32,7 @@ Document::Document() { } endStyled = 0; enteredCount = 0; + enteredReadOnlyCount = 0; tabInChars = 8; watchers = 0; lenWatchers = 0; @@ -292,10 +293,13 @@ void Document::ModifiedAt(int pos) { // Unlike Undo, Redo, and InsertStyledString, the pos argument is a cell number not a char number void Document::DeleteChars(int pos, int len) { + if (cb.IsReadOnly() && enteredReadOnlyCount==0) { + enteredReadOnlyCount++; + NotifyModifyAttempt(); + enteredReadOnlyCount--; + } if (enteredCount == 0) { enteredCount++; - if (cb.IsReadOnly()) - NotifyModifyAttempt(); if (!cb.IsReadOnly()) { int prevLinesTotal = LinesTotal(); bool startSavePoint = cb.IsSavePoint(); @@ -312,10 +316,13 @@ void Document::DeleteChars(int pos, int len) { } void Document::InsertStyledString(int position, char *s, int insertLength) { + if (cb.IsReadOnly() && enteredReadOnlyCount==0) { + enteredReadOnlyCount++; + NotifyModifyAttempt(); + enteredReadOnlyCount--; + } if (enteredCount == 0) { enteredCount++; - if (cb.IsReadOnly()) - NotifyModifyAttempt(); if (!cb.IsReadOnly()) { int prevLinesTotal = LinesTotal(); bool startSavePoint = cb.IsSavePoint(); diff --git a/src/Document.h b/src/Document.h index 4c212b7bd..7ab187573 100644 --- a/src/Document.h +++ b/src/Document.h @@ -77,6 +77,7 @@ private: int stylingMask; int endStyled; int enteredCount; + int enteredReadOnlyCount; WatcherWithUserData *watchers; int lenWatchers; |