summaryrefslogtreecommitdiffstats
path: root/generic/tkText.c
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2010-02-21 13:23:12 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2010-02-21 13:23:12 (GMT)
commit80644402b89c57db590c5fd60da0ffa447ae6cd2 (patch)
treebce09a8b7ee32fd524e651ee6903cc349e05f10c /generic/tkText.c
parente0086f7726b9fbe6a1f97fe3ac09366191ce3ad8 (diff)
downloadtk-80644402b89c57db590c5fd60da0ffa447ae6cd2.zip
tk-80644402b89c57db590c5fd60da0ffa447ae6cd2.tar.gz
tk-80644402b89c57db590c5fd60da0ffa447ae6cd2.tar.bz2
Refix [Bug 1799782].
Diffstat (limited to 'generic/tkText.c')
-rw-r--r--generic/tkText.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/generic/tkText.c b/generic/tkText.c
index 518af81..c1be9d9 100644
--- a/generic/tkText.c
+++ b/generic/tkText.c
@@ -13,7 +13,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkText.c,v 1.79.2.5 2010/01/29 12:41:11 nijtmans Exp $
+ * RCS: @(#) $Id: tkText.c,v 1.79.2.6 2010/02/21 13:23:13 dkf Exp $
*/
#include "default.h"
@@ -5000,7 +5000,7 @@ TextEditCmd(
Tcl_WrongNumArgs(interp, 3, objv, "?boolean?");
return TCL_ERROR;
} else {
- int setModified;
+ int setModified, oldModified;
if (Tcl_GetBooleanFromObj(interp, objv[3],
&setModified) != TCL_OK) {
@@ -5013,13 +5013,22 @@ TextEditCmd(
setModified = setModified ? 1 : 0;
+ oldModified = textPtr->sharedTextPtr->isDirty;
textPtr->sharedTextPtr->isDirty = setModified;
if (setModified) {
textPtr->sharedTextPtr->dirtyMode = TK_TEXT_DIRTY_FIXED;
} else {
textPtr->sharedTextPtr->dirtyMode = TK_TEXT_DIRTY_NORMAL;
}
- GenerateModifiedEvent(textPtr);
+
+ /*
+ * Only issue the <<Modified>> event if the flag actually changed.
+ * However, degree of modified-ness doesn't matter. [Bug 1799782]
+ */
+
+ if ((!oldModified) != (!setModified)) {
+ GenerateModifiedEvent(textPtr);
+ }
}
break;
case EDIT_REDO: