[gnumeric] SHEETS: Fix leaks.
- From: Morten Welinder <mortenw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnumeric] SHEETS: Fix leaks.
- Date: Sun, 22 May 2011 02:11:06 +0000 (UTC)
commit 084afb211315cb72f9dd9ee9f42a8cfea33db1b0
Author: Morten Welinder <terra gnome org>
Date: Sat May 21 22:10:53 2011 -0400
SHEETS: Fix leaks.
NEWS | 1 +
plugins/fn-lookup/ChangeLog | 1 +
plugins/fn-lookup/functions.c | 8 ++++----
3 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/NEWS b/NEWS
index 1453305..3429466 100644
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,7 @@ Gnumeric 1.10.16
Morten:
* Fix leaks in SHEET. [#650761]
+ * Fix leaks in SHEETS. [#650764]
--------------------------------------------------------------------------
Gnumeric 1.10.15
diff --git a/plugins/fn-lookup/ChangeLog b/plugins/fn-lookup/ChangeLog
index ce7e4a8..4154dfc 100644
--- a/plugins/fn-lookup/ChangeLog
+++ b/plugins/fn-lookup/ChangeLog
@@ -1,6 +1,7 @@
2011-05-21 Morten Welinder <terra gnome org>
* functions.c (gnumeric_sheet): Simplify. Fixes #650761.
+ (gnumeric_sheets): Simplify. Fixes #650764.
2011-05-21 Morten Welinder <terra gnome org>
diff --git a/plugins/fn-lookup/functions.c b/plugins/fn-lookup/functions.c
index 630e218..5223a34 100644
--- a/plugins/fn-lookup/functions.c
+++ b/plugins/fn-lookup/functions.c
@@ -1584,11 +1584,11 @@ gnumeric_sheets (GnmFuncEvalInfo *ei, GnmValue const * const *args)
GnmRangeRef const *r = &v->v_range.cell;
int ans_min, ans_max, a, b;
- a = g_slist_index (workbook_sheets (wb), r->a.sheet);
- b = g_slist_index (workbook_sheets (wb), r->b.sheet);
+ a = r->a.sheet ? r->a.sheet->index_in_wb : -1;
+ b = r->b.sheet ? r->b.sheet->index_in_wb : -1;
- ans_min = (a < b) ? a : b;
- ans_max = (a < b) ? b : a;
+ ans_min = MIN (a,b);
+ ans_max = MAX (a,b);
if (ans_min == -1)
return value_new_int (1);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]