summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2022-12-12 19:59:38 (GMT)
committerfvogel <fvogelnew1@free.fr>2022-12-12 19:59:38 (GMT)
commit9fac9b66aef229b3540f8b6ad93735aa68025356 (patch)
tree2a8c0b6e13f52276f64602229157794f83a5200d /generic
parent9ef14f63b395e482eb711ce33617b11993dc55f9 (diff)
parent72e0f8b3e611e86f8646d36ee861e8d37c27909c (diff)
downloadtk-9fac9b66aef229b3540f8b6ad93735aa68025356.zip
tk-9fac9b66aef229b3540f8b6ad93735aa68025356.tar.gz
tk-9fac9b66aef229b3540f8b6ad93735aa68025356.tar.bz2
Fix [6ee162c3d9]: Style configuring Treeview -rowheight 0 crashes. Also, document -indent treeview styling option.
Diffstat (limited to 'generic')
-rw-r--r--generic/ttk/ttkLabel.c2
-rw-r--r--generic/ttk/ttkLayout.c4
-rw-r--r--generic/ttk/ttkTreeview.c2
3 files changed, 4 insertions, 4 deletions
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))) {