[gnumeric] Filters: fix (harmless) critical.
- From: Morten Welinder <mortenw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnumeric] Filters: fix (harmless) critical.
- Date: Thu, 11 Mar 2010 17:48:17 +0000 (UTC)
commit e5a2161a1aa4da4bcb06a6f0f44c06e675dc11cb
Author: Morten Welinder <terra gnome org>
Date: Thu Mar 11 12:47:55 2010 -0500
Filters: fix (harmless) critical.
ChangeLog | 3 +++
NEWS | 1 +
src/commands.c | 37 ++++++++++++++++++++++++-------------
3 files changed, 28 insertions(+), 13 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 13b1357..a092d4a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
2010-03-11 Morten Welinder <terra gnome org>
+ * src/commands.c (cmd_autofilter_add_remove): Remove extra
+ gnm_filter_remove call. Fixes #611073.
+
* src/print-info.c (page_setup_set_paper): Avoid some calls to
g_log even if we block the warnings it would print. This helps
debugging.
diff --git a/NEWS b/NEWS
index e6c06f4..8a3265f 100644
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,7 @@ Gnumeric 1.10.2
Morten:
* Improve object sizing tooltip positioning a bit.
+ * Fix filter critical. [#611073]
--------------------------------------------------------------------------
Gnumeric 1.10.1
diff --git a/src/commands.c b/src/commands.c
index bace60c..1e3bfac 100644
--- a/src/commands.c
+++ b/src/commands.c
@@ -7567,9 +7567,10 @@ cmd_autofilter_add_remove (WorkbookControl *wbc)
CmdAutofilterAddRemove *me;
SheetView *sv = wb_control_cur_sheet_view (wbc);
GnmFilter *f = sv_editpos_in_filter (sv);
- gboolean add = FALSE;
+ gboolean add = (f == NULL);
+ char *descr;
- if (f == NULL) {
+ if (add) {
GnmRange region;
GnmRange const *src = selection_first_range (sv,
GO_CMD_CONTEXT (wbc), _("Add Filter"));
@@ -7583,32 +7584,42 @@ cmd_autofilter_add_remove (WorkbookControl *wbc)
if (src->start.row == src->end.row)
gnm_sheet_guess_region (sv->sheet, ®ion);
if (region.start.row == region.end.row) {
- go_cmd_context_error_invalid (GO_CMD_CONTEXT (wbc),
- _("AutoFilter"), _("Requires more than 1 row"));
+ go_cmd_context_error_invalid
+ (GO_CMD_CONTEXT (wbc),
+ _("AutoFilter"),
+ _("Requires more than 1 row"));
return TRUE;
}
f = gnm_filter_new (sv->sheet, ®ion);
if (f == NULL) {
- go_cmd_context_error_invalid (GO_CMD_CONTEXT (wbc),
- _("AutoFilter"), _("Unable to create Autofilter"));
+ go_cmd_context_error_invalid
+ (GO_CMD_CONTEXT (wbc),
+ _("AutoFilter"),
+ _("Unable to create Autofilter"));
return TRUE;
}
gnm_filter_remove (f);
- add = TRUE;
- } else
- gnm_filter_remove (f);
-
+
+ descr = g_strdup_printf (_("Add Autofilter to %s"),
+ range_as_string (&(f->r)));
+ } else {
+ /*
+ * Removing a filter.
+ * This actual removal is in the redo handler.
+ */
+ descr = g_strdup_printf (_("Remove Autofilter from %s"),
+ range_as_string (&(f->r)));
+ }
+
me = g_object_new (CMD_AUTOFILTER_ADD_REMOVE_TYPE, NULL);
me->cmd.sheet = sv->sheet;
me->cmd.size = 1;
+ me->cmd.cmd_descriptor = descr;
me->filter = f;
me->add = add;
- me->cmd.cmd_descriptor = add ? g_strdup_printf (_("Add Autofilter to %s"), range_as_string (&(f->r)))
- : g_strdup_printf (_("Remove Autofilter from %s"), range_as_string (&(f->r)));
-
sheet_redraw_all (sv->sheet, TRUE);
sheet_mark_dirty (sv->sheet);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]