diff options
author | donal.k.fellows@manchester.ac.uk <dkf> | 2010-03-11 09:24:02 (GMT) |
---|---|---|
committer | donal.k.fellows@manchester.ac.uk <dkf> | 2010-03-11 09:24:02 (GMT) |
commit | 3669e6559fe36c91710b1266f0e052a241e9a456 (patch) | |
tree | 2d2e52feae96e890ecd9c448210469e3faab6f8c | |
parent | dd4d9f1a9c0d75fbaa9c9af4cbe5a3d35d2bb26c (diff) | |
download | tk-3669e6559fe36c91710b1266f0e052a241e9a456.zip tk-3669e6559fe36c91710b1266f0e052a241e9a456.tar.gz tk-3669e6559fe36c91710b1266f0e052a241e9a456.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.
-rw-r--r-- | ChangeLog | 11 | ||||
-rw-r--r-- | generic/tkText.c | 21 | ||||
-rw-r--r-- | tests/text.test | 10 |
3 files changed, 30 insertions, 12 deletions
@@ -1,6 +1,13 @@ +2010-03-11 Donal K. Fellows <dkf@users.sf.net> + + * 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. + 2010-03-08 Don Porter <dgp@users.sourceforge.net> - * generic/tkPlatDecls.h: Correct broken 2886635 fix. [Bug 2965600] + * generic/tkPlatDecls.h: [Bug 2965600]: Correct broken 2886635 fix. 2010-03-06 Pat Thoyts <patthoyts@users.sourceforge.net> @@ -12,7 +19,7 @@ * unix/configure.in: Don't use -fvisibility=hidden * unix/tcl.m4: for cygwin. - * win/tkWinTest.c Make tkTestWinProcs const + * win/tkWinTest.c: Make tkTestWinProcs const 2010-03-04 Donal K. Fellows <dkf@users.sf.net> 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, diff --git a/tests/text.test b/tests/text.test index 5d3060a..cb2c006 100644 --- a/tests/text.test +++ b/tests/text.test @@ -6,7 +6,7 @@ # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. # -# RCS: @(#) $Id: text.test,v 1.55 2009/10/22 21:36:24 dkf Exp $ +# RCS: @(#) $Id: text.test,v 1.56 2010/03/11 09:24:09 dkf Exp $ package require tcltest 2.2 eval tcltest::configure $argv @@ -5875,7 +5875,13 @@ test text-24.26 {TextDumpCmd procedure, unicode characters} -body { } -cleanup { destroy .t } -result "text abc\xb1\xb1\xb1 1.0 mark insert 1.6 mark current 1.6 text {\n} 1.6" - +test text-24.27 {TextDumpCmd procedure, peer present} -body { + text .t + .t peer create .t.t + .t dump -all 1.0 end +} -cleanup { + destroy .t +} -result "mark insert 1.0 mark current 1.0 text {\n} 1.0" test text-25.1 {text widget vs hidden commands} -body { text .t |