From 85dce0069233d416365af44c28305e10308857d8 Mon Sep 17 00:00:00 2001 From: Morten Welinder Date: Wed, 18 Apr 2018 21:33:45 -0400 Subject: [PATCH] GnmStyle: fix precondition for conditional style. (And that's why we have a test suite.) --- ChangeLog | 3 +++ src/mstyle.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 7bd8967c2..acb240795 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2018-04-18 Morten Welinder + * src/mstyle.c (gnm_style_get_cond_style): Flip reversed + pre-condition. + * src/gui-clipboard.c (gnm_x_claim_clipboard): Offer biff8, including LO's weird name for that. The don't seem to take "Biff8" and they don't seem to take Citrix' variant either. diff --git a/src/mstyle.c b/src/mstyle.c index b46f87482..02c2dac44 100644 --- a/src/mstyle.c +++ b/src/mstyle.c @@ -2085,7 +2085,7 @@ gnm_style_get_cond_style (GnmStyle const *style, int ix) g_return_val_if_fail (elem_is_set (style, MSTYLE_CONDITIONS), NULL); g_return_val_if_fail (style->cond_styles != NULL, NULL); - g_return_val_if_fail (ix < 0 || (unsigned)ix > style->cond_styles->len, NULL); + g_return_val_if_fail (ix >= 0 && (unsigned)ix < style->cond_styles->len, NULL); return g_ptr_array_index (style->cond_styles, ix); } -- 2.11.4.GIT