Skip to content

Commit

Permalink
Eliminate info.commandSize, which is no longer necessary. This also u…
Browse files Browse the repository at this point in the history
…nbreaks the Windows build.
  • Loading branch information
jan.nijtmans committed Oct 14, 2024
1 parent 03959bc commit c1b0cc0
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 10 deletions.
6 changes: 0 additions & 6 deletions generic/tkScrollbar.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
Expand Down
1 change: 0 additions & 1 deletion generic/tkScrollbar.h
Original file line number Diff line number Diff line change
Expand Up @@ -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). */
Expand Down
5 changes: 2 additions & 3 deletions win/tkWinScrlbr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit c1b0cc0

Please sign in to comment.