From c1b0cc0c0e0020c46e9a302876654713ab517753 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 14 Oct 2024 10:00:46 +0000 Subject: [PATCH] Eliminate info.commandSize, which is no longer necessary. This also unbreaks the Windows build. --- generic/tkScrollbar.c | 6 ------ generic/tkScrollbar.h | 1 - win/tkWinScrlbr.c | 5 ++--- 3 files changed, 2 insertions(+), 10 deletions(-) diff --git a/generic/tkScrollbar.c b/generic/tkScrollbar.c index 9ac47168c..3060c5f5f 100644 --- a/generic/tkScrollbar.c +++ b/generic/tkScrollbar.c @@ -160,7 +160,6 @@ Tk_ScrollbarObjCmd( scrollPtr->vertical = 0; scrollPtr->width = 0; scrollPtr->commandObj = NULL; - scrollPtr->commandSize = 0; scrollPtr->repeatDelay = 0; scrollPtr->repeatInterval = 0; scrollPtr->borderWidth = 0; @@ -545,11 +544,6 @@ ConfigureScrollbar( * from a 3-D border. */ - if (scrollPtr->commandObj != NULL) { - scrollPtr->commandSize = (int) strlen(Tcl_GetString(scrollPtr->commandObj)); - } else { - scrollPtr->commandSize = 0; - } if (scrollPtr->highlightWidth < 0) { scrollPtr->highlightWidth = 0; } diff --git a/generic/tkScrollbar.h b/generic/tkScrollbar.h index 9ac3d249f..b3b1d86b3 100644 --- a/generic/tkScrollbar.h +++ b/generic/tkScrollbar.h @@ -43,7 +43,6 @@ typedef struct TkScrollbar { Tcl_Obj *commandObj; /* Command prefix to use when invoking * scrolling commands. NULL means don't invoke * commands. */ - int commandSize; /* Number of non-NULL bytes in command. */ int repeatDelay; /* How long to wait before auto-repeating on * scrolling actions (in ms). */ int repeatInterval; /* Interval between autorepeats (in ms). */ diff --git a/win/tkWinScrlbr.c b/win/tkWinScrlbr.c index a54deebc8..b34f19869 100644 --- a/win/tkWinScrlbr.c +++ b/win/tkWinScrlbr.c @@ -504,14 +504,13 @@ ScrollbarProc( * Bail out immediately if there isn't a command to invoke. */ - if (scrollPtr->info.commandSize == 0) { + if (!scrollPtr->info.commandObj) { Tcl_ServiceAll(); return 0; } Tcl_DStringInit(&cmdString); - Tcl_DStringAppend(&cmdString, scrollPtr->info.command, - scrollPtr->info.commandSize); + Tcl_DStringAppend(&cmdString, Tcl_GetString(scrollPtr->info.commandObj), TCL_INDEX_NONE); if (command == SB_LINELEFT || command == SB_LINERIGHT) { Tcl_DStringAppendElement(&cmdString, "scroll");