Skip to content

Commit

Permalink
Merge 8.6
Browse files Browse the repository at this point in the history
  • Loading branch information
jan.nijtmans committed Sep 3, 2024
2 parents e841835 + d6a4426 commit 3f0b859
Show file tree
Hide file tree
Showing 4 changed files with 78 additions and 77 deletions.
1 change: 1 addition & 0 deletions doc/keysyms.n
Original file line number Diff line number Diff line change
Expand Up @@ -1096,6 +1096,7 @@ dead_U 65161 0xFE89
dead_schwa 65162 0xFE8A
dead_SCHWA 65163 0xFE8B
dead_greek 65164 0xFE8C
dead_hamza 65165 0xFE8D
dead_lowline 65168 0xFE90
dead_aboveverticalline 65169 0xFE91
dead_belowverticalline 65170 0xFE92
Expand Down
2 changes: 1 addition & 1 deletion generic/tkOldTest.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ typedef struct TImageModel {
int width, height; /* Dimensions of image. */
char *imageName; /* Name of image (malloc-ed). */
char *varName; /* Name of variable in which to log events for
* image (malloc-ed). */
* image (malloc-ed). */
} TImageModel;

/*
Expand Down
98 changes: 49 additions & 49 deletions generic/tkScale.c
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ enum command {
static void ComputeFormat(TkScale *scalePtr, int forTicks);
static void ComputeScaleGeometry(TkScale *scalePtr);
static int ConfigureScale(Tcl_Interp *interp, TkScale *scalePtr,
int objc, Tcl_Obj *const objv[]);
Tcl_Size objc, Tcl_Obj *const objv[]);
static void DestroyScale(void *memPtr);
static double MaxTickRoundingError(TkScale *scalePtr,
double tickResolution);
Expand Down Expand Up @@ -590,7 +590,7 @@ ConfigureScale(
Tcl_Interp *interp, /* Used for error reporting. */
TkScale *scalePtr, /* Information about widget; may or may not
* already have values for some fields. */
int objc, /* Number of valid entries in objv. */
Tcl_Size objc, /* Number of valid entries in objv. */
Tcl_Obj *const objv[]) /* Argument values. */
{
Tk_SavedOptions savedOptions;
Expand Down Expand Up @@ -647,10 +647,10 @@ ConfigureScale(
}
}

/*
* The fromValue shall not be rounded to the resolution, but the
* toValue and tickInterval do.
*/
/*
* The fromValue shall not be rounded to the resolution, but the
* toValue and tickInterval do.
*/

scalePtr->toValue = TkRoundValueToResolution(scalePtr, scalePtr->toValue);
scalePtr->tickInterval = TkRoundIntervalToResolution(scalePtr,
Expand Down Expand Up @@ -712,9 +712,9 @@ ConfigureScale(
} else {
char varString[TCL_DOUBLE_SPACE], scaleString[TCL_DOUBLE_SPACE];

Tcl_PrintDouble(NULL, varValue, varString);
Tcl_PrintDouble(NULL, scalePtr->value, scaleString);
if (strcmp(varString, scaleString)) {
Tcl_PrintDouble(NULL, varValue, varString);
Tcl_PrintDouble(NULL, scalePtr->value, scaleString);
if (strcmp(varString, scaleString)) {
ScaleSetVariable(scalePtr);
}
}
Expand Down Expand Up @@ -1056,14 +1056,14 @@ ComputeScaleGeometry(
*/

if (snprintf(valueString, TCL_DOUBLE_SPACE, scalePtr->valueFormat,
scalePtr->fromValue) < 0) {
valueString[TCL_DOUBLE_SPACE - 1] = '\0';
scalePtr->fromValue) < 0) {
valueString[TCL_DOUBLE_SPACE - 1] = '\0';
}
valuePixels = Tk_TextWidth(scalePtr->tkfont, valueString, -1);

if (snprintf(valueString, TCL_DOUBLE_SPACE, scalePtr->valueFormat,
scalePtr->toValue) < 0) {
valueString[TCL_DOUBLE_SPACE - 1] = '\0';
scalePtr->toValue) < 0) {
valueString[TCL_DOUBLE_SPACE - 1] = '\0';
}
tmp = Tk_TextWidth(scalePtr->tkfont, valueString, -1);
if (valuePixels < tmp) {
Expand All @@ -1075,14 +1075,14 @@ ComputeScaleGeometry(
*/

if (snprintf(valueString, TCL_DOUBLE_SPACE, scalePtr->tickFormat,
scalePtr->fromValue) < 0) {
valueString[TCL_DOUBLE_SPACE - 1] = '\0';
scalePtr->fromValue) < 0) {
valueString[TCL_DOUBLE_SPACE - 1] = '\0';
}
tickPixels = Tk_TextWidth(scalePtr->tkfont, valueString, -1);

if (snprintf(valueString, TCL_DOUBLE_SPACE, scalePtr->tickFormat,
scalePtr->toValue) < 0) {
valueString[TCL_DOUBLE_SPACE - 1] = '\0';
scalePtr->toValue) < 0) {
valueString[TCL_DOUBLE_SPACE - 1] = '\0';
}
tmp = Tk_TextWidth(scalePtr->tkfont, valueString, -1);
if (tickPixels < tmp) {
Expand Down Expand Up @@ -1277,7 +1277,7 @@ TkRoundValueToResolution(
double value) /* Value to round. */
{
return TkRoundIntervalToResolution(scalePtr, value - scalePtr->fromValue)
+ scalePtr->fromValue;
+ scalePtr->fromValue;
}

double
Expand All @@ -1294,13 +1294,13 @@ TkRoundIntervalToResolution(
rounded = scalePtr->resolution * tick;
rem = value - rounded;
if (rem < 0) {
if (rem <= -scalePtr->resolution/2) {
rounded = (tick - 1.0) * scalePtr->resolution;
}
if (rem <= -scalePtr->resolution/2) {
rounded = (tick - 1.0) * scalePtr->resolution;
}
} else {
if (rem >= scalePtr->resolution/2) {
rounded = (tick + 1.0) * scalePtr->resolution;
}
if (rem >= scalePtr->resolution/2) {
rounded = (tick + 1.0) * scalePtr->resolution;
}
}
return rounded;
}
Expand Down Expand Up @@ -1344,27 +1344,27 @@ ScaleVarProc(
*/

if (flags & TCL_TRACE_UNSETS) {
if (!Tcl_InterpDeleted(interp) && scalePtr->varNamePtr) {
void *probe = NULL;

do {
probe = Tcl_VarTraceInfo(interp,
Tcl_GetString(scalePtr->varNamePtr),
TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS,
ScaleVarProc, probe);
if (probe == (void *)scalePtr) {
break;
}
} while (probe);
if (probe) {
/*
* We were able to fetch the unset trace for our
* varNamePtr, which means it is not unset and not
* the cause of this unset trace. Instead some outdated
* former variable must be, and we should ignore it.
*/
return NULL;
}
if (!Tcl_InterpDeleted(interp) && scalePtr->varNamePtr) {
void *probe = NULL;

do {
probe = Tcl_VarTraceInfo(interp,
Tcl_GetString(scalePtr->varNamePtr),
TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS,
ScaleVarProc, probe);
if (probe == (void *)scalePtr) {
break;
}
} while (probe);
if (probe) {
/*
* We were able to fetch the unset trace for our
* varNamePtr, which means it is not unset and not
* the cause of this unset trace. Instead some outdated
* former variable must be, and we should ignore it.
*/
return NULL;
}
Tcl_TraceVar2(interp, Tcl_GetString(scalePtr->varNamePtr),
NULL, TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS,
ScaleVarProc, clientData);
Expand Down Expand Up @@ -1490,10 +1490,10 @@ ScaleSetVariable(
if (scalePtr->varNamePtr != NULL) {
char string[TCL_DOUBLE_SPACE];

if (snprintf(string, TCL_DOUBLE_SPACE, scalePtr->valueFormat,
scalePtr->value) < 0) {
string[TCL_DOUBLE_SPACE - 1] = '\0';
}
if (snprintf(string, TCL_DOUBLE_SPACE, scalePtr->valueFormat,
scalePtr->value) < 0) {
string[TCL_DOUBLE_SPACE - 1] = '\0';
}
scalePtr->flags |= SETTING_VAR;
Tcl_ObjSetVar2(scalePtr->interp, scalePtr->varNamePtr, NULL,
Tcl_NewStringObj(string, TCL_INDEX_NONE), TCL_GLOBAL_ONLY);
Expand Down
54 changes: 27 additions & 27 deletions generic/tkText.c
Original file line number Diff line number Diff line change
Expand Up @@ -1475,8 +1475,8 @@ TextWidgetObjCmd(
deleteInsertOffset = insertLength;
}

indexFromLine = TkBTreeLinesTo(textPtr, indexFromPtr->linePtr);
indexFromByteOffset = indexFromPtr->byteIndex;
indexFromLine = TkBTreeLinesTo(textPtr, indexFromPtr->linePtr);
indexFromByteOffset = indexFromPtr->byteIndex;

result = TextReplaceCmd(textPtr, interp, indexFromPtr,
indexToPtr, objc, objv, 0);
Expand All @@ -1486,11 +1486,11 @@ TextWidgetObjCmd(
* Move the insertion position to the correct place.
*/

TkTextIndex indexTmp;
TkTextIndex indexTmp;

TkTextMakeByteIndex(textPtr->sharedTextPtr->tree, textPtr, indexFromLine,
indexFromByteOffset, &indexTmp);
TkTextIndexForwChars(NULL, &indexTmp,
TkTextMakeByteIndex(textPtr->sharedTextPtr->tree, textPtr, indexFromLine,
indexFromByteOffset, &indexTmp);
TkTextIndexForwChars(NULL, &indexTmp,
deleteInsertOffset, &index, COUNT_INDICES);
TkBTreeUnlinkSegment(textPtr->insertMarkPtr,
textPtr->insertMarkPtr->body.mark.linePtr);
Expand Down Expand Up @@ -2733,9 +2733,9 @@ InsertChars(
*/

for (tPtr = sharedTextPtr->peers; tPtr != NULL ; tPtr = tPtr->next) {
if (TkBTreeCharTagged(indexPtr, tPtr->selTagPtr)) {
TkTextSelectionEvent(tPtr);
}
if (TkBTreeCharTagged(indexPtr, tPtr->selTagPtr)) {
TkTextSelectionEvent(tPtr);
}
tPtr->abortSelections = 1;
}

Expand Down Expand Up @@ -2873,9 +2873,9 @@ TextPushUndoAction(
Tcl_ListObjAppendElement(NULL, markGravityRUndoMarkCmdObj,
Tcl_NewStringObj(rMarkName, TCL_INDEX_NONE));
Tcl_ListObjAppendElement(NULL, markGravityLUndoMarkCmdObj,
Tcl_NewStringObj("left", 4));
Tcl_NewStringObj("left", 4));
Tcl_ListObjAppendElement(NULL, markGravityRUndoMarkCmdObj,
Tcl_NewStringObj("right", 5));
Tcl_NewStringObj("right", 5));

/*
* Note: we don't wish to use textPtr->widgetCmd in these callbacks
Expand Down Expand Up @@ -3200,7 +3200,7 @@ DeleteIndexRange(

for (i=0, hPtr=Tcl_FirstHashEntry(&sharedTextPtr->tagTable, &search);
hPtr != NULL; i++, hPtr = Tcl_NextHashEntry(&search)) {
TkBTreeTag(&index1, &index2, (TkTextTag *)Tcl_GetHashValue(hPtr), 0);
TkBTreeTag(&index1, &index2, (TkTextTag *)Tcl_GetHashValue(hPtr), 0);
}

/*
Expand All @@ -3210,7 +3210,7 @@ DeleteIndexRange(

for (tPtr = sharedTextPtr->peers; tPtr != NULL ;
tPtr = tPtr->next) {
if (TkBTreeTag(&index1, &index2, tPtr->selTagPtr, 0)) {
if (TkBTreeTag(&index1, &index2, tPtr->selTagPtr, 0)) {
/*
* Send an event that the selection changed. This is
* equivalent to:
Expand All @@ -3219,7 +3219,7 @@ DeleteIndexRange(

TkTextSelectionEvent(textPtr);
tPtr->abortSelections = 1;
}
}
}

/*
Expand Down Expand Up @@ -5149,13 +5149,13 @@ TextEditUndo(
*/

cmdObj = Tcl_ObjPrintf("::tk::TextUndoRedoProcessMarks %s",
Tk_PathName(textPtr->tkwin));
Tk_PathName(textPtr->tkwin));
Tcl_IncrRefCount(cmdObj);
code = Tcl_EvalObjEx(textPtr->interp, cmdObj, TCL_EVAL_GLOBAL);
if (code != TCL_OK) {
Tcl_AddErrorInfo(textPtr->interp,
"\n (on undoing)");
Tcl_BackgroundException(textPtr->interp, code);
Tcl_AddErrorInfo(textPtr->interp,
"\n (on undoing)");
Tcl_BackgroundException(textPtr->interp, code);
}
Tcl_DecrRefCount(cmdObj);

Expand Down Expand Up @@ -5215,13 +5215,13 @@ TextEditRedo(
*/

cmdObj = Tcl_ObjPrintf("::tk::TextUndoRedoProcessMarks %s",
Tk_PathName(textPtr->tkwin));
Tk_PathName(textPtr->tkwin));
Tcl_IncrRefCount(cmdObj);
code = Tcl_EvalObjEx(textPtr->interp, cmdObj, TCL_EVAL_GLOBAL);
if (code != TCL_OK) {
Tcl_AddErrorInfo(textPtr->interp,
"\n (on undoing)");
Tcl_BackgroundException(textPtr->interp, code);
Tcl_AddErrorInfo(textPtr->interp,
"\n (on undoing)");
Tcl_BackgroundException(textPtr->interp, code);
}
Tcl_DecrRefCount(cmdObj);

Expand Down Expand Up @@ -6161,13 +6161,13 @@ SearchCore(
break;
} else {
alreadySearchOffset -= (matchLength ? matchLength : 1);
if (alreadySearchOffset < 0) {
break;
}
if (alreadySearchOffset < 0) {
break;
}
}
} else {
firstOffset = matchLength ? p - startOfLine + matchLength
: p - startOfLine + (Tcl_Size)1;
firstOffset = matchLength ? p - startOfLine + matchLength
: p - startOfLine + (Tcl_Size)1;
if (firstOffset >= lastOffset) {
/*
* Now, we have to be careful not to find
Expand Down

0 comments on commit 3f0b859

Please sign in to comment.