From 74fa155b951cf1affd9f941460e6f4bca456abbf Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Tue, 17 Oct 2006 00:32:34 +0000 Subject: Armel Asselin contributed a feature that adds the flag SC_STARTACTION to modification notifications where the modification is the first step of an undo transaction. This is used to synchronize with the container's undo stack. --- src/Document.cxx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/Document.cxx') diff --git a/src/Document.cxx b/src/Document.cxx index 92be92691..fee76840d 100644 --- a/src/Document.cxx +++ b/src/Document.cxx @@ -380,7 +380,8 @@ bool Document::DeleteChars(int pos, int len) { 0, 0)); int prevLinesTotal = LinesTotal(); bool startSavePoint = cb.IsSavePoint(); - const char *text = cb.DeleteChars(pos * 2, len * 2); + bool startSequence = false; + const char *text = cb.DeleteChars(pos * 2, len * 2, startSequence); if (startSavePoint && cb.IsCollectingUndo()) NotifySavePoint(!startSavePoint); if ((pos < Length()) || (pos == 0)) @@ -389,7 +390,7 @@ bool Document::DeleteChars(int pos, int len) { ModifiedAt(pos-1); NotifyModified( DocModification( - SC_MOD_DELETETEXT | SC_PERFORMED_USER, + SC_MOD_DELETETEXT | SC_PERFORMED_USER | (startSequence?SC_STARTACTION:0), pos, len, LinesTotal() - prevLinesTotal, text)); } @@ -415,13 +416,14 @@ bool Document::InsertStyledString(int position, char *s, int insertLength) { 0, s)); int prevLinesTotal = LinesTotal(); bool startSavePoint = cb.IsSavePoint(); - const char *text = cb.InsertString(position, s, insertLength); + bool startSequence = false; + const char *text = cb.InsertString(position, s, insertLength, startSequence); if (startSavePoint && cb.IsCollectingUndo()) NotifySavePoint(!startSavePoint); ModifiedAt(position / 2); NotifyModified( DocModification( - SC_MOD_INSERTTEXT | SC_PERFORMED_USER, + SC_MOD_INSERTTEXT | SC_PERFORMED_USER | (startSequence?SC_STARTACTION:0), position / 2, insertLength / 2, LinesTotal() - prevLinesTotal, text)); } -- cgit v1.2.3