diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2006-03-20 22:16:32 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2006-03-20 22:16:32 (GMT) |
commit | 6fc882c0064facc4bcd4b054d33fa9c33969758a (patch) | |
tree | d326cfc66dfb93b230a68bcd1dd7d63a6a987c76 /generic | |
parent | 61b0fcc820634ac1e3f1f3e27d25bba45f404085 (diff) | |
download | tk-6fc882c0064facc4bcd4b054d33fa9c33969758a.zip tk-6fc882c0064facc4bcd4b054d33fa9c33969758a.tar.gz tk-6fc882c0064facc4bcd4b054d33fa9c33969758a.tar.bz2 |
Fix [Bug 1380427] with [Patch 1391939]
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tkUndo.c | 36 |
1 files changed, 8 insertions, 28 deletions
diff --git a/generic/tkUndo.c b/generic/tkUndo.c index c860021..cbb3fac 100644 --- a/generic/tkUndo.c +++ b/generic/tkUndo.c @@ -8,7 +8,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkUndo.c,v 1.1.4.1 2004/07/14 19:07:48 hobbs Exp $ + * RCS: @(#) $Id: tkUndo.c,v 1.1.4.2 2006/03/20 22:16:34 dkf Exp $ */ #include "tkUndo.h" @@ -190,12 +190,15 @@ void TkUndoSetDepth ( stack, maxdepth ) stack->maxdepth = maxdepth; if ((stack->maxdepth > 0) && (stack->depth > stack->maxdepth)) { - /* Maximum stack depth exceeded. We have to remove the last compound - elements on the stack */ + /* + * Maximum stack depth exceeded. We have to remove the last compound + * elements on the stack. + */ + elem = stack->undoStack; prevelem = NULL; - while ( sepNumber <= stack->maxdepth ) { - if (elem != NULL && (elem->type == TK_UNDO_SEPARATOR) ) { + while (elem && (sepNumber <= stack->maxdepth)) { + if (elem->type == TK_UNDO_SEPARATOR) { sepNumber++; } prevelem = elem; @@ -268,32 +271,9 @@ void TkUndoFreeStack ( stack ) void TkUndoInsertUndoSeparator ( stack ) TkUndoRedoStack * stack; { -/* TkUndoAtom * elem; - TkUndoAtom * prevelem; - int sepNumber = 0; -*/ - if ( TkUndoInsertSeparator(&(stack->undoStack)) ) { ++(stack->depth); TkUndoSetDepth(stack,stack->maxdepth); -/* if ((stack->maxdepth > 0) && (stack->depth > stack->maxdepth)) { - elem = stack->undoStack; - prevelem = NULL; - while ( sepNumber < stack->depth ) { - if (elem != NULL && (elem->type == TK_UNDO_SEPARATOR) ) { - sepNumber++; - } - prevelem = elem; - elem = elem->next; - } - prevelem->next = NULL; - while ( elem ) { - prevelem = elem; - elem = elem->next; - ckfree((char *) elem); - } - stack->depth; - } */ } } |