diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2010-03-11 09:24:02 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2010-03-11 09:24:02 (GMT) |
commit | 3259fbc2451dd52b8aec46351254cf38818b3b83 (patch) | |
tree | 2d2e52feae96e890ecd9c448210469e3faab6f8c /generic/tkText.c | |
parent | 9a9c7a13cd0fc38e33f205a83cd439ead0512192 (diff) | |
download | tk-3259fbc2451dd52b8aec46351254cf38818b3b83.zip tk-3259fbc2451dd52b8aec46351254cf38818b3b83.tar.gz tk-3259fbc2451dd52b8aec46351254cf38818b3b83.tar.bz2 |
* generic/tkText.c (DumpLine): [Bug 2968379]: When peers are about,
there can be unnamed marks present during a dump. Ignore them as they
will just be for the peers' insert and current marks, which aren't
very important.
Diffstat (limited to 'generic/tkText.c')
-rw-r--r-- | generic/tkText.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/generic/tkText.c b/generic/tkText.c index 650e77b..49cfae0 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.97 2010/02/22 23:38:53 nijtmans Exp $ + * RCS: @(#) $Id: tkText.c,v 1.98 2010/03/11 09:24:07 dkf Exp $ */ #include "default.h" @@ -3115,7 +3115,7 @@ DeleteIndexRange( } else { lineAndByteIndex[resetViewCount] = -1; } - resetViewCount+=2; + resetViewCount += 2; } /* @@ -4580,8 +4580,8 @@ TextDumpCmd( if (lineno == lineend) { break; } - textChanged = DumpLine(interp, textPtr, what, linePtr, 0, 32000000, - lineno, command); + textChanged = DumpLine(interp, textPtr, what, linePtr, 0, + 32000000, lineno, command); if (textChanged) { if (textPtr->flags & DESTROYED) { return TCL_OK; @@ -4716,14 +4716,19 @@ DumpLine( name = "insert"; } else if (segPtr == textPtr->currentMarkPtr) { name = "current"; + } else if (markPtr->hPtr == NULL) { + name = NULL; + lineChanged = 0; } else { name = Tcl_GetHashKey(&textPtr->sharedTextPtr->markTable, markPtr->hPtr); } - TkTextMakeByteIndex(textPtr->sharedTextPtr->tree, textPtr, - lineno, offset, &index); - lineChanged = DumpSegment(textPtr, interp, "mark", name, - command, &index, what); + if (name != NULL) { + TkTextMakeByteIndex(textPtr->sharedTextPtr->tree, textPtr, + lineno, offset, &index); + lineChanged = DumpSegment(textPtr, interp, "mark", name, + command, &index, what); + } } else if ((what & TK_DUMP_TAG) && (segPtr->typePtr == &tkTextToggleOnType)) { TkTextMakeByteIndex(textPtr->sharedTextPtr->tree, textPtr, |