diff options
author | nyamatongwe <unknown> | 2002-07-26 00:46:05 +0000 |
---|---|---|
committer | nyamatongwe <unknown> | 2002-07-26 00:46:05 +0000 |
commit | ae2e6e1e905413081c1cb32ece081d1416ae3f53 (patch) | |
tree | 37208d83e60ac5e26f013abafea75e092a634883 /src/Document.cxx | |
parent | c71161481a532f7bf19edbcf817d2ea8f7673172 (diff) | |
download | scintilla-mirror-ae2e6e1e905413081c1cb32ece081d1416ae3f53.tar.gz |
Patch from John Ehresman to return false from styling operations when
reentering causes styling to not be performed.
Diffstat (limited to 'src/Document.cxx')
-rw-r--r-- | src/Document.cxx | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/src/Document.cxx b/src/Document.cxx index 22cb0c2b0..97ca97adc 100644 --- a/src/Document.cxx +++ b/src/Document.cxx @@ -354,7 +354,9 @@ bool Document::DeleteChars(int pos, int len) { NotifyModifyAttempt(); enteredReadOnlyCount--; } - if (enteredCount == 0) { + if (enteredCount != 0) { + return false; + } else { enteredCount++; if (!cb.IsReadOnly()) { NotifyModified( @@ -388,7 +390,9 @@ bool Document::InsertStyledString(int position, char *s, int insertLength) { NotifyModifyAttempt(); enteredReadOnlyCount--; } - if (enteredCount == 0) { + if (enteredCount != 0) { + return false; + } else { enteredCount++; if (!cb.IsReadOnly()) { NotifyModified( @@ -823,8 +827,9 @@ class DocumentIndexer : public CharacterIndexer { Document *pdoc; int end; public: -DocumentIndexer(Document *pdoc_, int end_) : - pdoc(pdoc_), end(end_) {} + DocumentIndexer(Document *pdoc_, int end_) : + pdoc(pdoc_), end(end_) { + } virtual char CharAt(int index) { if (index < 0 || index >= end) @@ -1082,8 +1087,10 @@ void Document::StartStyling(int position, char mask) { endStyled = position; } -void Document::SetStyleFor(int length, char style) { - if (enteredCount == 0) { +bool Document::SetStyleFor(int length, char style) { + if (enteredCount != 0) { + return false; + } else { enteredCount++; int prevEndStyled = endStyled; if (cb.SetStyleFor(endStyled, length, style, stylingMask)) { @@ -1093,11 +1100,14 @@ void Document::SetStyleFor(int length, char style) { } endStyled += length; enteredCount--; + return true; } } -void Document::SetStyles(int length, char *styles) { - if (enteredCount == 0) { +bool Document::SetStyles(int length, char *styles) { + if (enteredCount != 0) { + return false; + } else { enteredCount++; int prevEndStyled = endStyled; bool didChange = false; @@ -1113,6 +1123,7 @@ void Document::SetStyles(int length, char *styles) { NotifyModified(mh); } enteredCount--; + return true; } } |