From 3e9b0ec4e334067a8f477b8d6ffe3afbcb7b3c58 Mon Sep 17 00:00:00 2001 From: dkf Date: Sun, 21 Feb 2010 13:23:12 +0000 Subject: Refix [Bug 1799782]. --- ChangeLog | 5 +++++ generic/tkText.c | 15 ++++++++++++--- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index a7bd389..163077a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2010-02-21 Donal K. Fellows + + * generic/tkText.c (TextEditCmd): [Bug 1799782]: Refix this, so that + <> events are issued when things change. + 2010-02-19 Donal K. Fellows * unix/installManPage: [Tcl Bug 2954638]: Correct behaviour of manual 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 <> 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: -- cgit v0.12