summaryrefslogtreecommitdiffstats
path: root/generic/tkText.c
diff options
context:
space:
mode:
authordonal.k.fellows@manchester.ac.uk <dkf>2010-02-21 12:11:12 (GMT)
committerdonal.k.fellows@manchester.ac.uk <dkf>2010-02-21 12:11:12 (GMT)
commit9f3ca543b4610b6996c8b8516164974b3234da19 (patch)
tree5a5a63f94895b287d1b60dce0469ae97be3a7172 /generic/tkText.c
parente0ed7f2cc0e3a5006635619f1d002a85fc5492e6 (diff)
downloadtk-9f3ca543b4610b6996c8b8516164974b3234da19.zip
tk-9f3ca543b4610b6996c8b8516164974b3234da19.tar.gz
tk-9f3ca543b4610b6996c8b8516164974b3234da19.tar.bz2
Re-fix [Bug 1799782].
Diffstat (limited to 'generic/tkText.c')
-rw-r--r--generic/tkText.c24
1 files changed, 17 insertions, 7 deletions
diff --git a/generic/tkText.c b/generic/tkText.c
index 6cd7072..d6e232a 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.95 2010/01/18 20:43:38 nijtmans Exp $
+ * RCS: @(#) $Id: tkText.c,v 1.96 2010/02/21 12:11:13 dkf Exp $
*/
#include "default.h"
@@ -4317,6 +4317,7 @@ TkTextGetTabs(
count = 0;
for (i = 0; i < objc; i++) {
char c = Tcl_GetString(objv[i])[0];
+
if ((c != 'l') && (c != 'r') && (c != 'c') && (c != 'n')) {
count++;
}
@@ -4351,8 +4352,8 @@ TkTextGetTabs(
}
prevStop = lastStop;
- if (Tk_GetDoublePixelsFromObj (interp, textPtr->tkwin, objv[i],
- &lastStop) != TCL_OK) {
+ if (Tk_GetDoublePixelsFromObj(interp, textPtr->tkwin, objv[i],
+ &lastStop) != TCL_OK) {
goto error;
}
@@ -4411,7 +4412,7 @@ TkTextGetTabs(
"tab alignment", 0, &index) != TCL_OK) {
goto error;
}
- tabPtr->alignment = ((TkTextTabAlign)index);
+ tabPtr->alignment = (TkTextTabAlign) index;
}
/*
@@ -5021,7 +5022,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) {
@@ -5034,13 +5035,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:
@@ -5173,7 +5183,7 @@ TextGetText(
*
* GenerateModifiedEvent --
*
- * Send an event that the text was modified. This is equivalent to
+ * Send an event that the text was modified. This is equivalent to:
* event generate $textWidget <<Modified>>
*
* Results: