diff options
author | dgp <dgp@users.sourceforge.net> | 2022-10-28 15:19:29 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2022-10-28 15:19:29 (GMT) |
commit | bccd593f9b95af88a31221402a12abc53f38485f (patch) | |
tree | 5f3e3d7634ddad717f59251f34530c26ec8c424c /generic | |
parent | 7a1d6e12e1c747db49ad887f7ce1d143f3dbcff7 (diff) | |
parent | eadd3b5f08832d7d4ac7be519985b1977f70623b (diff) | |
download | tk-bccd593f9b95af88a31221402a12abc53f38485f.zip tk-bccd593f9b95af88a31221402a12abc53f38485f.tar.gz tk-bccd593f9b95af88a31221402a12abc53f38485f.tar.bz2 |
merge 8.6
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tkCanvas.c | 18 | ||||
-rw-r--r-- | generic/tkEntry.c | 8 | ||||
-rw-r--r-- | generic/tkListbox.c | 5 | ||||
-rw-r--r-- | generic/ttk/ttkScroll.c | 4 |
4 files changed, 17 insertions, 18 deletions
diff --git a/generic/tkCanvas.c b/generic/tkCanvas.c index aa23203..b80c197 100644 --- a/generic/tkCanvas.c +++ b/generic/tkCanvas.c @@ -7,7 +7,7 @@ * * Copyright (c) 1991-1994 The Regents of the University of California. * Copyright (c) 1994-1997 Sun Microsystems, Inc. - * Copyright (c) 1998-1999 by Scriptics Corporation. + * Copyright (c) 1998-1999 Scriptics Corporation. * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. @@ -2064,14 +2064,11 @@ CanvasWidgetCmd( } args = TkGetStringsFromObjs(objc, objv); - type = Tk_GetScrollInfo(interp, objc, args, &fraction, &count); + type = Tk_GetScrollInfoObj(interp, objc, objv, &fraction, &count); if (args != NULL) { ckfree(args); } switch (type) { - case TK_SCROLL_ERROR: - result = TCL_ERROR; - goto done; case TK_SCROLL_MOVETO: newX = canvasPtr->scrollX1 - canvasPtr->inset + (int) (fraction * (canvasPtr->scrollX2 @@ -2089,6 +2086,9 @@ CanvasWidgetCmd( * (Tk_Width(canvasPtr->tkwin) - 2*canvasPtr->inset)); } break; + default: + result = TCL_ERROR; + goto done; } CanvasSetOrigin(canvasPtr, newX, canvasPtr->yOrigin); break; @@ -2110,14 +2110,11 @@ CanvasWidgetCmd( } args = TkGetStringsFromObjs(objc, objv); - type = Tk_GetScrollInfo(interp, objc, args, &fraction, &count); + type = Tk_GetScrollInfoObj(interp, objc, objv, &fraction, &count); if (args != NULL) { ckfree(args); } switch (type) { - case TK_SCROLL_ERROR: - result = TCL_ERROR; - goto done; case TK_SCROLL_MOVETO: newY = canvasPtr->scrollY1 - canvasPtr->inset + (int) ( fraction*(canvasPtr->scrollY2-canvasPtr->scrollY1) + 0.5); @@ -2134,6 +2131,9 @@ CanvasWidgetCmd( * (Tk_Height(canvasPtr->tkwin) - 2*canvasPtr->inset)); } break; + default: + result = TCL_ERROR; + goto done; } CanvasSetOrigin(canvasPtr, canvasPtr->xOrigin, newY); break; diff --git a/generic/tkEntry.c b/generic/tkEntry.c index a6684c7..bf7626a 100644 --- a/generic/tkEntry.c +++ b/generic/tkEntry.c @@ -953,8 +953,6 @@ EntryWidgetObjCmd( index = entryPtr->leftIndex; switch (Tk_GetScrollInfoObj(interp, objc, objv, &fraction, &count)) { - case TK_SCROLL_ERROR: - goto error; case TK_SCROLL_MOVETO: index = (int) ((fraction * entryPtr->numChars) + 0.5); break; @@ -972,6 +970,8 @@ EntryWidgetObjCmd( case TK_SCROLL_UNITS: index += count; break; + default: + goto error; } } if (index >= entryPtr->numChars) { @@ -4181,8 +4181,6 @@ SpinboxWidgetObjCmd( index = entryPtr->leftIndex; switch (Tk_GetScrollInfoObj(interp, objc, objv, &fraction, &count)) { - case TK_SCROLL_ERROR: - goto error; case TK_SCROLL_MOVETO: index = (int) ((fraction * entryPtr->numChars) + 0.5); break; @@ -4201,6 +4199,8 @@ SpinboxWidgetObjCmd( case TK_SCROLL_UNITS: index += count; break; + default: + goto error; } } if (index >= entryPtr->numChars) { diff --git a/generic/tkListbox.c b/generic/tkListbox.c index 79c644a..7977d43 100644 --- a/generic/tkListbox.c +++ b/generic/tkListbox.c @@ -1280,8 +1280,6 @@ ListboxXviewSubCmd( ChangeListboxOffset(listPtr, index*listPtr->xScrollUnit); } else { switch (Tk_GetScrollInfoObj(interp, objc, objv, &fraction, &count)) { - case TK_SCROLL_ERROR: - return TCL_ERROR; case TK_SCROLL_MOVETO: offset = (int) (fraction*listPtr->maxWidth + 0.5); break; @@ -1297,6 +1295,8 @@ ListboxXviewSubCmd( case TK_SCROLL_UNITS: offset = listPtr->xOffset + count*listPtr->xScrollUnit; break; + default: + return TCL_ERROR; } ChangeListboxOffset(listPtr, offset); } @@ -1367,7 +1367,6 @@ ListboxYviewSubCmd( case TK_SCROLL_UNITS: index = listPtr->topIndex + count; break; - case TK_SCROLL_ERROR: default: return TCL_ERROR; } diff --git a/generic/ttk/ttkScroll.c b/generic/ttk/ttkScroll.c index 9cf8eae..c3b847a 100644 --- a/generic/ttk/ttkScroll.c +++ b/generic/ttk/ttkScroll.c @@ -229,8 +229,6 @@ int TtkScrollviewCommand( int count; switch (Tk_GetScrollInfoObj(interp, objc, objv, &fraction, &count)) { - case TK_SCROLL_ERROR: - return TCL_ERROR; case TK_SCROLL_MOVETO: newFirst = (int) ((fraction * s->total) + 0.5); break; @@ -242,6 +240,8 @@ int TtkScrollviewCommand( newFirst = s->first + count * perPage; break; } + default: + return TCL_ERROR; } } |