summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2022-12-12 23:17:45 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2022-12-12 23:17:45 (GMT)
commite9874f07bc4c22c3a2fa1c6dd04b427ead29f7fe (patch)
tree57ac5b19c6f8dbeb453755ac9b456975b43bc375 /generic
parent772f4eae7bc74750f8338fd75d2a29c4f08e14b1 (diff)
parent8c86e56bde55ae0c26ac7fc3a78f6a22d2181f8f (diff)
downloadtk-e9874f07bc4c22c3a2fa1c6dd04b427ead29f7fe.zip
tk-e9874f07bc4c22c3a2fa1c6dd04b427ead29f7fe.tar.gz
tk-e9874f07bc4c22c3a2fa1c6dd04b427ead29f7fe.tar.bz2
Merge 8.7
Diffstat (limited to 'generic')
-rw-r--r--generic/nanosvg.h2
-rw-r--r--generic/tkImgPhoto.c8
-rw-r--r--generic/ttk/ttkLabel.c2
-rw-r--r--generic/ttk/ttkLayout.c4
-rw-r--r--generic/ttk/ttkTreeview.c2
5 files changed, 7 insertions, 11 deletions
diff --git a/generic/nanosvg.h b/generic/nanosvg.h
index ee0eb5d..04d6d88 100644
--- a/generic/nanosvg.h
+++ b/generic/nanosvg.h
@@ -3152,7 +3152,7 @@ NSVGimage* nsvgParse(char* input, const char* units, float dpi)
// Create gradients after all definitions have been parsed
nsvg__createGradients(p);
-
+
/* Scale to viewBox */
nsvg__scaleToViewbox(p, units);
diff --git a/generic/tkImgPhoto.c b/generic/tkImgPhoto.c
index 992f4bd..9c95ae8 100644
--- a/generic/tkImgPhoto.c
+++ b/generic/tkImgPhoto.c
@@ -1973,22 +1973,20 @@ ImgPhotoConfigureModel(
Tcl_Obj *oldData, *data = NULL, *oldFormat, *format = NULL,
*metadataInObj = NULL, *metadataOutObj = NULL;
Tcl_Obj *tempdata, *tempformat;
- Tcl_Size length;
- Tcl_Size i, j;
+ Tcl_Size i, length;
int result, imageWidth, imageHeight, oldformat;
double oldGamma;
Tcl_Channel chan;
Tk_PhotoImageFormat *imageFormat;
Tk_PhotoImageFormatVersion3 *imageFormatVersion3;
- for (i = 0, j = 0; i < objc; i++,j++) {
+ for (i = 0; i < objc; i++) {
const char *arg = Tcl_GetStringFromObj(objv[i], &length);
if ((length > 1) && (arg[0] == '-')) {
if ((arg[1] == 'd') &&
!strncmp(arg, "-data", length)) {
if (++i < objc) {
data = objv[i];
- j--;
} else {
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"value for \"-data\" missing", -1));
@@ -2000,7 +1998,6 @@ ImgPhotoConfigureModel(
!strncmp(arg, "-format", length)) {
if (++i < objc) {
format = objv[i];
- j--;
} else {
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"value for \"-format\" missing", -1));
@@ -2012,7 +2009,6 @@ ImgPhotoConfigureModel(
!strncmp(arg, "-metadata", length)) {
if (++i < objc) {
metadataInObj = objv[i];
- j--;
} else {
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"value for \"-metadata\" missing", -1));
diff --git a/generic/ttk/ttkLabel.c b/generic/ttk/ttkLabel.c
index 882f5de..46243b0 100644
--- a/generic/ttk/ttkLabel.c
+++ b/generic/ttk/ttkLabel.c
@@ -509,7 +509,7 @@ static const Ttk_ElementOptionSpec LabelElementOptions[] = {
*/
#undef MAX
-#define MAX(a,b) ((a) > (b) ? a : b);
+#define MAX(a,b) ((a) > (b) ? (a) : (b));
static void LabelSetup(
LabelElement *c, Tk_Window tkwin, Ttk_State state)
{
diff --git a/generic/ttk/ttkLayout.c b/generic/ttk/ttkLayout.c
index 1b1d6bb..1ead013 100644
--- a/generic/ttk/ttkLayout.c
+++ b/generic/ttk/ttkLayout.c
@@ -9,8 +9,8 @@
#include "tkInt.h"
#include "ttkThemeInt.h"
-#define MAX(a,b) (a > b ? a : b)
-#define MIN(a,b) (a < b ? a : b)
+#define MAX(a,b) ((a) > (b) ? (a) : (b))
+#define MIN(a,b) ((a) < (b) ? (a) : (b))
/*------------------------------------------------------------------------
* +++ Ttk_Box and Ttk_Padding utilities:
diff --git a/generic/ttk/ttkTreeview.c b/generic/ttk/ttkTreeview.c
index f784d36..61f43c3 100644
--- a/generic/ttk/ttkTreeview.c
+++ b/generic/ttk/ttkTreeview.c
@@ -1918,13 +1918,13 @@ static Ttk_Layout TreeviewGetLayout(
if ((objPtr = Ttk_QueryOption(treeLayout, "-rowheight", 0))) {
(void)Tcl_GetIntFromObj(NULL, objPtr, &tv->tree.rowHeight);
+ tv->tree.rowHeight = MAX(tv->tree.rowHeight, 1);
}
if ((objPtr = Ttk_QueryOption(treeLayout, "-columnseparatorwidth", 0))) {
(void)Tcl_GetIntFromObj(NULL, objPtr, &tv->tree.colSeparatorWidth);
}
/* Get item indent from style:
- * @@@ TODO: sanity-check.
*/
tv->tree.indent = DEFAULT_INDENT;
if ((objPtr = Ttk_QueryOption(treeLayout, "-indent", 0))) {